MCPcopy
hub / github.com/pydata/xarray / test_encode_cf_datetime_overflow

Function test_encode_cf_datetime_overflow

xarray/tests/test_coding_times.py:875–883  ·  view source on GitHub ↗
(shape)

Source from the content-addressed store, hash-verified

873@requires_cftime
874@pytest.mark.parametrize("shape", [(24,), (8, 3), (2, 4, 3)])
875def test_encode_cf_datetime_overflow(shape) -> None:
876 # Test for fix to GH 2272
877 dates = pd.date_range("2100", periods=24).values.reshape(shape)
878 units = "days since 1800-01-01"
879 calendar = "standard"
880
881 num, _, _ = encode_cf_datetime(dates, units, calendar)
882 roundtrip = decode_cf_datetime(num, units, calendar)
883 np.testing.assert_array_equal(dates, roundtrip)
884
885
886def test_encode_expected_failures() -> None:

Callers

nothing calls this directly

Calls 2

encode_cf_datetimeFunction · 0.90
decode_cf_datetimeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…