From 211fd6a588e7fafb445aa3e82a47425b806c24ae Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:07:28 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- finch/processes/ensemble_utils.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/finch/processes/ensemble_utils.py b/finch/processes/ensemble_utils.py index 0ddd1dd9..823420a1 100644 --- a/finch/processes/ensemble_utils.py +++ b/finch/processes/ensemble_utils.py @@ -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)