home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 430460404

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
430460404 MDExOlB1bGxSZXF1ZXN0MjY4MzQzMTM1 2879 Reduce length of cftime resample tests 6628425 closed 0     5 2019-04-08T13:44:50Z 2019-04-11T11:42:16Z 2019-04-11T11:42:09Z MEMBER   0 pydata/xarray/pulls/2879

The main issue is that we were resampling the same time indexes across a large range of frequencies, in some cases producing very long results, e.g. resampling an index that spans 27 years to a frequency of 12 hours.

This modifies the primary test so that it constructs time indexes whose ranges are based on the frequencies we resample to. Now in total the tests in test_cftimeindex_resample.py take around 6 seconds.

@jwenfai I did some coverage analysis offline, and these tests produce the same coverage that we had before (I found it necessary to be sure to test cases where the reference index had either a shorter or longer frequency than the resample frequency). Do you think what I have here is sufficient? I think we could potentially shorten things even more, but I'm not sure if it's worth the effort.

  • [x] Closes #2874

See below for the new profiling results; now the longest cftime tests are no longer associated with resample.

$ pytest -k cftime --durations=50 ... 0.18s call xarray/tests/test_backends.py::TestScipyInMemoryData::test_roundtrip_cftime_datetime_data 0.11s call xarray/tests/test_backends.py::TestScipyFilePath::test_roundtrip_cftime_datetime_data 0.10s call xarray/tests/test_backends.py::TestNetCDF4Data::test_roundtrip_cftime_datetime_data 0.09s call xarray/tests/test_backends.py::TestNetCDF4ClassicViaNetCDF4Data::test_roundtrip_cftime_datetime_data 0.09s call xarray/tests/test_backends.py::TestNetCDF4ViaDaskData::test_roundtrip_cftime_datetime_data 0.08s teardown xarray/tests/test_cftime_offsets.py::test_add_year_end_onOffset[julian-(2, 12)-()-<YearEnd: n=-1, month=12>-(1, 12)-()] 0.06s call xarray/tests/test_backends.py::TestNetCDF3ViaNetCDF4Data::test_roundtrip_cftime_datetime_data 0.06s call xarray/tests/test_backends.py::TestGenericNetCDFData::test_roundtrip_cftime_datetime_data 0.05s call xarray/tests/test_backends.py::TestScipyFileObject::test_roundtrip_cftime_datetime_data 0.04s call xarray/tests/test_conventions.py::TestCFEncodedDataStore::test_roundtrip_cftime_datetime_data 0.03s call xarray/tests/test_dataset.py::test_differentiate_cftime[True] 0.03s call xarray/tests/test_dataset.py::test_trapz_datetime[cftime-True] 0.02s call xarray/tests/test_coding_times.py::test_contains_cftime_datetimes_dask_3d[standard] 0.02s call xarray/tests/test_backends.py::test_use_cftime_standard_calendar_default_out_of_range[2500-gregorian] 0.02s call xarray/tests/test_dataset.py::test_differentiate_cftime[False] 0.02s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-24-right-None-4A-MAY] 0.02s call xarray/tests/test_backends.py::test_use_cftime_standard_calendar_default_in_range[gregorian] 0.02s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-24-None-right-11Q-JUN] 0.02s call xarray/tests/test_backends.py::test_use_cftime_standard_calendar_default_out_of_range[2500-proleptic_gregorian] 0.02s call xarray/tests/test_backends.py::test_use_cftime_true[1500-gregorian] 0.02s call xarray/tests/test_backends.py::test_use_cftime_true[2500-proleptic_gregorian] 0.01s call xarray/tests/test_backends.py::test_use_cftime_true[2000-gregorian] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-31-None-right-4A-MAY] 0.01s call xarray/tests/test_backends.py::test_use_cftime_standard_calendar_default_out_of_range[2500-standard] 0.01s call xarray/tests/test_backends.py::test_use_cftime_true[1500-julian] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-31-left-right-4A-MAY] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-24-right-None-11Q-JUN] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-24-None-right-4A-MAY] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-31-left-None-7M] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-24-left-None-4A-MAY] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-24-left-right-4A-MAY] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-31-None-None-11Q-JUN] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-24-right-right-4A-MAY] 0.01s call xarray/tests/test_backends.py::test_use_cftime_standard_calendar_default_out_of_range[1500-proleptic_gregorian] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-24-left-None-11Q-JUN] 0.01s call xarray/tests/test_backends.py::test_use_cftime_true[2500-julian] 0.01s call xarray/tests/test_backends.py::test_use_cftime_standard_calendar_default_out_of_range[1500-gregorian] 0.01s call xarray/tests/test_backends.py::test_use_cftime_true[1500-proleptic_gregorian] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-31-left-right-11Q-JUN] 0.01s call xarray/tests/test_backends.py::test_use_cftime_true[2000-standard] 0.01s call xarray/tests/test_backends.py::test_use_cftime_true[2500-standard] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-31-None-None-4A-MAY] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-31-right-right-11Q-JUN] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-24-right-right-7M] 0.01s call xarray/tests/test_backends.py::test_use_cftime_true[2500-gregorian] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-24-left-right-7M] 0.01s call xarray/tests/test_backends.py::test_use_cftime_true[2000-proleptic_gregorian] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-31-right-None-7M] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-31-None-right-7M] 0.01s call xarray/tests/test_cftimeindex_resample.py::test_resample[longer_da_freq-31-left-None-11Q-JUN]

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2879/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 240.379ms · About: xarray-datasette