Skip to content

Commit 08756c2

Browse files
fix tests
1 parent 91af2d5 commit 08756c2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pyremo/preproc/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def convert_units(ds):
169169
def check_lev(ds, invert=None):
170170
"""Check for order of levels and invert if neccessary"""
171171

172-
if ds.ta.cf["vertical"].attrs.get("positive") == "down" and invert is None:
172+
if ds.cf["vertical"].attrs.get("positive") == "down" and invert is None:
173173
invert = True
174174
# if "vertical" in ds.cf and auto is True:
175175
# positive = ds.cf["vertical"].attrs.get("positive", None)
@@ -179,7 +179,7 @@ def check_lev(ds, invert=None):
179179
# warnings.warn("could not determine positive attribute of vertical axis.")
180180
# return ds
181181
if invert is True:
182-
kwargs = {ds.ta.cf["vertical"].name: ds.ta.cf["vertical"][::-1]}
182+
kwargs = {ds.cf["vertical"].name: ds.cf["vertical"][::-1]}
183183
print("inverting vertical axis")
184184
return ds.reindex(**kwargs)
185185
return ds

tests/test_preproc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pandas as pd
44
import pyremo as pr
5-
from pyremo.preproc import gfile, remap
5+
from pyremo.preproc import get_gcm_dataset, remap
66
from pyremo.tutorial import load_dataset, mpi_esm, mpi_esm_tos
77
from pyremo.preproc.utils import get_filename
88

@@ -16,7 +16,9 @@ def ds():
1616

1717
# @pytest.fixture
1818
def gcm_ds1():
19-
return gfile(mpi_esm(use_cftime=True), tos=mpi_esm_tos(use_cftime=True).tos)
19+
return get_gcm_dataset(
20+
mpi_esm(use_cftime=True), tos=mpi_esm_tos(use_cftime=True).tos
21+
)
2022

2123

2224
# @pytest.fixture
@@ -32,7 +34,7 @@ def gcm_ds2():
3234
}
3335

3436
file_dict = {k: load_dataset(f).encoding["source"] for k, f in files.items()}
35-
return gfile(file_dict, tos=mpi_esm_tos(use_cftime=True).tos)
37+
return get_gcm_dataset(file_dict, tos=mpi_esm_tos(use_cftime=True).tos)
3638

3739

3840
# @requires_pyintorg

0 commit comments

Comments
 (0)