Skip to content

Commit 1b1bf8a

Browse files
committed
Tidy up for ruff
1 parent 614a990 commit 1b1bf8a

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

CMIP7/esm1p6/atmosphere/cmip7_ancil_common.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ def interpolate_monthly(cube, beg_year, end_year):
172172

173173
# Add month categorisation to extract each month's series
174174
if not cube.coords("month_number"):
175-
iris.coord_categorisation.add_month_number(cube, "time", name="month_number")
175+
iris.coord_categorisation.add_month_number(
176+
cube, "time", name="month_number"
177+
)
176178

177179
# Interpolate each month separately and interleave the data
178180
for m in range(1, MONTHS_IN_A_YEAR + 1):
@@ -182,8 +184,11 @@ def interpolate_monthly(cube, beg_year, end_year):
182184
# Select target time points for this month across all years
183185
m_tpoints = tpoints[m - 1 :: MONTHS_IN_A_YEAR]
184186
# Interpolate across the years for this month
185-
m_interpolated = m_cube.interpolate([("time", m_tpoints)], iris.analysis.Linear())
186-
# Place the interpolated data back into the interleaved target indices
187+
m_interpolated = m_cube.interpolate(
188+
[("time", m_tpoints)], iris.analysis.Linear()
189+
)
190+
# Place the interpolated data back
191+
# into the interleaved target indices
187192
new_cube.data[m - 1 :: MONTHS_IN_A_YEAR] = m_interpolated.data
188193

189194
# Clean up month_number coordinate if added

0 commit comments

Comments
 (0)