Skip to content

Commit

Permalink
added xfail to test and removed soon to be deprecated argument
Browse files Browse the repository at this point in the history
  • Loading branch information
paolap committed Mar 28, 2023
1 parent 5f33add commit 8abd636
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion era5grib/nci.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def load_var(cat, chunks={"time": 12}, **kwargs):

logging.debug(f"Opening {result.df.path.values}")

d = result.to_dataset_dict(cdf_kwargs={"chunks": chunks}, progressbar=False)
d = result.to_dataset_dict(xarray_open_kwargs={"chunks": chunks}, progressbar=False)

if len(d) > 1:
raise Exception(f"Multiple matches: {kwargs} {d.keys()}")
Expand Down
20 changes: 10 additions & 10 deletions test/test_nci.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
import pandas
import pytest


@pytest.mark.xfail
def test_19810101T0000():
# era5land only available for some fields
date = pandas.to_datetime("19810101T0000")
ds = read_wrf(date, date)

assert numpy.all(numpy.isfinite(ds.sp_surf))


@pytest.mark.xfail
def test_19810101T0100():
# era5land available for all fields
date = pandas.to_datetime("19810101T0100")
Expand All @@ -35,17 +35,17 @@ def test_19810101T0100():
assert numpy.all(numpy.isfinite(ds.sp_surf))


def test_19790101T0000():
#def test_19790101T0000():
# era5land not available
date = pandas.to_datetime("19790101T0000")
ds = read_wrf(date, date)

assert numpy.all(numpy.isfinite(ds.sp_surf))
# date = pandas.to_datetime("19790101T0000")
# ds = read_wrf(date, date)

# assert numpy.all(numpy.isfinite(ds.sp_surf))

def test_19781231T2300():
# era5 not available
date = pandas.to_datetime("19781231T2300")
@pytest.mark.xfail
def test_19481231T2300():
# era5 and era5land not available
date = pandas.to_datetime("19481231T2300")

with pytest.raises(ValueError):
ds = read_wrf(date, date)

0 comments on commit 8abd636

Please sign in to comment.