Skip to content

Commit 277e247

Browse files
committed
Fix pytest
1 parent 8421a3d commit 277e247

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

climetlab_maelstrom_yr/yr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ def preprocess(self, ds):
187187
coords[coord] = ds.variables[coord]
188188
coords["predictor"] = np.concatenate((ds["predictor"].values, ds["static_predictor"].values))
189189
if self.probabilistic_target:
190-
coords["target"] = np.array(["mean", "std"], np.object)
190+
coords["target"] = np.array(["mean", "std"], object)
191191
else:
192-
coords["target"] = np.array(["mean"], np.object)
192+
coords["target"] = np.array(["mean"], object)
193193

194194
# Copy variables from input
195195
data_vars = dict()

tests/test_yr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
import climetlab as cml
44
import pandas as pd
5+
import os
56

67
from climetlab_maelstrom_yr.yr import Yr
78

89
def test_read():
10+
dir = os.path.join(os.path.dirname(__file__), "files")
911
ds = cml.load_dataset(
1012
"maelstrom-yr",
1113
size="5GB",
1214
dates=["2020-03-01", "2020-03-02"],
13-
location="files/",
15+
location=f"{dir}/",
1416
probabilistic_target=False,
1517
verbose=True,
1618
)

0 commit comments

Comments
 (0)