Skip to content

Commit

Permalink
Fix defaults for t1-t0 (#43)
Browse files Browse the repository at this point in the history
* change mlp settings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove imports

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* improve imports

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* better?

* bworks better?

* remove faulty test

* fix defaults
  • Loading branch information
JoranAngevaare committed Jun 9, 2023
1 parent 4e69fd9 commit 8877ed1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions optim_esm_tools/analyze/cmip_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

_seconds_to_year = 365.25 * 24 * 3600
folder_fmt = 'model_group model scenario run domain variable grid version'.split()
__OPTIM_VERSION__ = '0.1.9'
__OPTIM_VERSION__ = '0.1.10'


def _native_date_fmt(time_array: np.array, date: ty.Tuple[int, int, int]):
Expand Down Expand Up @@ -261,8 +261,8 @@ def running_mean_diff(
rename_to: str = 'long_name',
unit: str = 'absolute',
apply_abs: bool = True,
_t_0_date: ty.Optional[tuple] = (2015, 1, 1),
_t_1_date: ty.Optional[tuple] = (2100, 1, 1),
_t_0_date: ty.Optional[tuple] = None,
_t_1_date: ty.Optional[tuple] = None,
) -> xr.Dataset:
"""Return difference in running mean of data set
Expand Down Expand Up @@ -600,7 +600,9 @@ def time_series(self, variable='tas', running_mean=10):

time = 'time'
time_rm = time
ds = self.data_set.mean(dim=['x', 'y'])
ds = self.data_set.copy()
if all(xy in ds.dims for xy in 'xy'):
ds = ds.mean(dim=['x', 'y'])
plot_kw = dict(drawstyle='steps-mid')

_, axes = plt.subplots(3, 1, figsize=(12, 10), gridspec_kw=dict(hspace=0.3))
Expand Down

0 comments on commit 8877ed1

Please sign in to comment.