Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failing cftime upstream-dev tests #3928

Closed
keewis opened this issue Apr 2, 2020 · 0 comments · Fixed by #3930
Closed

failing cftime upstream-dev tests #3928

keewis opened this issue Apr 2, 2020 · 0 comments · Fixed by #3930

Comments

@keewis
Copy link
Collaborator

keewis commented Apr 2, 2020

Another set of failing cftime tests, this time because of warnings while calling open_dataset (I think?):

FAILED xarray/tests/test_backends.py::test_use_cftime_standard_calendar_default_in_range[gregorian]
FAILED xarray/tests/test_backends.py::test_use_cftime_standard_calendar_default_in_range[proleptic_gregorian]
FAILED xarray/tests/test_backends.py::test_use_cftime_standard_calendar_default_in_range[standard]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[1500-360_day]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[1500-standard]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2000-360_day]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2000-365_day]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2000-366_day]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2000-all_leap]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2000-gregorian]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2000-julian]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2000-noleap]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2000-proleptic_gregorian]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2000-standard]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2500-360_day]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2500-365_day]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2500-366_day]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2500-all_leap]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2500-gregorian]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2500-julian]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2500-noleap]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2500-proleptic_gregorian]
FAILED xarray/tests/test_backends.py::test_use_cftime_true[2500-standard]
FAILED xarray/tests/test_backends.py::test_use_cftime_false_standard_calendar_in_range[gregorian]
FAILED xarray/tests/test_backends.py::test_use_cftime_false_standard_calendar_in_range[proleptic_gregorian]
FAILED xarray/tests/test_backends.py::test_use_cftime_false_standard_calendar_in_range[standard]
________ test_use_cftime_standard_calendar_default_in_range[gregorian] _________

calendar = 'gregorian'
        for v in ["x", "time"]:
            original[v].attrs["units"] = units
            original[v].attrs["calendar"] = calendar
    
        x_timedeltas = np.array(x).astype("timedelta64[D]")
        time_timedeltas = np.array(time).astype("timedelta64[D]")
        decoded_x = np.datetime64(units_date, "ns") + x_timedeltas
        decoded_time = np.datetime64(units_date, "ns") + time_timedeltas
        expected_x = DataArray(decoded_x, [("time", decoded_time)], name="x")
        expected_time = DataArray(decoded_time, [("time", decoded_time)], name="time")
    
        with create_tmp_file() as tmp_file:
            original.to_netcdf(tmp_file)
            with pytest.warns(None) as record:
                with open_dataset(tmp_file, use_cftime=False) as ds:
                    assert_identical(expected_x, ds.x)
                    assert_identical(expected_time, ds.time)
>               assert not record
E               assert not WarningsChecker(record=True)

xarray/tests/test_backends.py:4378: AssertionError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant