Skip to content

Commit

Permalink
re-add whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmims committed Jan 16, 2025
1 parent 5a42bda commit 715bbf2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ def crop_date_range(self, case_date_range: util.DateRange, xr_ds, time_coord) ->
ds_end = self.cast_to_cftime(ds_end_time, cal)
date_range_cf_start = self.cast_to_cftime(case_date_range.start.lower, cal)
date_range_cf_end = self.cast_to_cftime(case_date_range.end.lower, cal)

if ds_start < date_range_cf_start and ds_end < date_range_cf_start or \
ds_end > date_range_cf_end and ds_start > date_range_cf_end:
new_xr_ds = None
Expand All @@ -933,7 +934,8 @@ def crop_date_range(self, case_date_range: util.DateRange, xr_ds, time_coord) ->
new_xr_ds = xr_ds.sel({time_coord.name: slice(ds_start, date_range_cf_end)})
# dataset contains all of requested date range
elif date_range_cf_start>=ds_start and date_range_cf_end<=ds_end:
new_xr_ds = xr_ds.sel({time_coord.name: slice(date_range_cf_start, date_range_cf_end)})
new_xr_ds = xr_ds.sel({time_coord.name: slice(date_range_cf_start, date_range_cf_end)}
)
return new_xr_ds

def check_group_daterange(self, df: pd.DataFrame, date_range: util.DateRange,
Expand Down

0 comments on commit 715bbf2

Please sign in to comment.