ESMValGroup / ESMValCore

ESMValCore: A community tool for pre-processing data from Earth system models in CMIP and running analysis scripts.
https://www.esmvaltool.org
Apache License 2.0
42 stars 38 forks source link

Tests involving `isodate` failed #2545

Closed schlunma closed 1 month ago

schlunma commented 1 month ago
=========================== short test summary info ============================
FAILED tests/integration/recipe/test_check.py::test_valid_time_selection[19900101T12H00M00S/19920101T12H00M00] - esmvalcore.exceptions.RecipeError: Invalid value encountered for `timerange`. Valid value must follow ISO 8601 standard for dates and duration periods, or be set to '*' to load available years. Got ['19900101T12H00M00S', '19920101T12H00M00'] instead.
FAILED tests/integration/recipe/test_check.py::test_valid_time_selection[19900101TH00M00S/P2Y2M1DT12H00M00S] - esmvalcore.exceptions.RecipeError: Invalid value encountered for `timerange`. Valid value must follow ISO 8601 standard for dates and duration periods, or be set to '*' to load available years. Got ['19900101TH00M00S', 'P2Y2M1DT12H00M00S'] instead.
FAILED tests/integration/recipe/test_check.py::test_valid_time_selection[P2Y2M1D/19920101T12H00M00S] - esmvalcore.exceptions.RecipeError: Invalid value encountered for `timerange`. Valid value must follow ISO 8601 standard for dates and duration periods, or be set to '*' to load available years. Got ['P2Y2M1D', '19920101T12H00M00S'] instead.
FAILED tests/integration/recipe/test_recipe.py::test_recipe_iso_timerange[19900101TH00M00S/P2Y2M1DT12H00M00S-19900101TH00M00S-P2Y2M1DT12H00M00S] - isodate.isoerror.ISO8601Error: Unrecognised ISO 8601 date format: '19900101TH00M00S'
FAILED tests/integration/recipe/test_recipe.py::test_recipe_iso_timerange[P1Y2M1D/19920101T12H00M00S-P1Y2M1D-19920101T12H00M00S] - isodate.isoerror.ISO8601Error: Unrecognised ISO 8601 date format: '19920101T12H00M00S'
FAILED tests/integration/recipe/test_recipe.py::test_recipe_iso_timerange_as_dataset[19900101TH00M00S/P2Y2M1DT12H00M00S-19900101TH00M00S-P2Y2M1DT12H00M00S] - isodate.isoerror.ISO8601Error: Unrecognised ISO 8601 date format: '19900101TH00M00S'
FAILED tests/integration/recipe/test_recipe.py::test_recipe_iso_timerange_as_dataset[P1Y2M1D/19920101T12H00M00S-P1Y2M1D-19920101T12H00M00S] - isodate.isoerror.ISO8601Error: Unrecognised ISO 8601 date format: '19920101T12H00M00S'
= 7 failed, 3877 passed, 13 skipped, 1 xpassed, 1081 warnings in 112.33s (0:01:52) =

See https://app.circleci.com/pipelines/github/ESMValGroup/ESMValCore/11808/workflows/9fcf7ed9-5d01-4686-a504-6aca0941b2aa/jobs/49698.

bouweandela commented 1 month ago

Something like 19900101T12H00M00S does not look like a valid datetime. It should probably be 19900101T120000. I think the H(our), M(inute), and S(econds) strings are only intended for use in periods not timestamps. See https://en.wikipedia.org/wiki/ISO_8601

bouweandela commented 1 month ago

Maybe the new release of https://pypi.org/project/isodate/ got more strict on this?

valeriupredoi commented 1 month ago

yeh it's 0.7.0 new release, but beats me if I can find any release notes

valeriupredoi commented 1 month ago

previous 0.6.1 is from 2021! Holy cow :cow: https://github.com/gweis/isodate/tags

at any rate here is the bit that's not recognizing the format, and rightly so, if you look at https://github.com/gweis/isodate/blob/9443e63119579217699dce88b86753a81a9bec52/src/isodate/isodates.py#L119 it's clear that don't support the date type in our test