Skip to content

Commit dbb727e

Browse files
daflackjfrost-mo
andauthored
Apply suggestions from code review
Co-authored-by: James Frost <[email protected]>
1 parent cc3b906 commit dbb727e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/CSET/operators/collapse.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def collapse_by_hour_of_day(
210210
cube = collapse_by_lead_time(
211211
cube, method, additional_percent=additional_percent
212212
)
213+
213214
# Categorise the time coordinate by hour of the day.
214215
iris.coord_categorisation.add_hour(cube, "time", name="hour")
215216
# Aggregate by the new category coordinate.
@@ -219,13 +220,15 @@ def collapse_by_hour_of_day(
219220
)
220221
else:
221222
collapsed_cube = cube.aggregated_by("hour", getattr(iris.analysis, method))
223+
222224
# Remove unnecessary time coordinates.
223225
collapsed_cube.remove_coord("time")
224226
collapsed_cube.remove_coord("forecast_period")
225227
# Remove forecast_reference_time if a single case, as collapse_by_lead_time
226228
# will have effectively done this if multi_case is True.
227229
if not multi_case:
228230
collapsed_cube.remove_coord("forecast_reference_time")
231+
229232
# Promote "hour" to dim_coord if monotonic.
230233
if collapsed_cube.coord("hour").is_monotonic():
231234
iris.util.promote_aux_coord_to_dim_coord(collapsed_cube, "hour")

0 commit comments

Comments
 (0)