Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 31, 2024
1 parent 00339cc commit 211fd6a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions finch/processes/ensemble_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,13 @@ def make_ensemble(
# make sure we have data starting in 1950
ensemble = ensemble.sel(time=(ensemble.time.dt.year >= 1950))

if len(ensemble.lon) == 1 and len(ensemble.lat)==1 and spatavg:
ensemble.attrs['history'] = (f"{ensemble.attrs['history']}:[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] "
f"spatial average flag is set to True but will be skipped as dataset contains a "
f"single point")
spatavg = False
if len(ensemble.lon) == 1 and len(ensemble.lat) == 1 and spatavg:
ensemble.attrs["history"] = (
f"{ensemble.attrs['history']}:[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] "
f"spatial average flag is set to True but will be skipped as dataset contains a "
f"single point"
)
spatavg = False

# If data is in day of year, percentiles won't make sense.
# Convert to "days since" (base will be the time coordinate)
Expand Down

0 comments on commit 211fd6a

Please sign in to comment.