Open MetRonnie opened 1 year ago
Note this does not fix https://github.com/cylc/cylc-flow/issues/2382, presumably that is still a bug in cylc-flow
Actually which should the behaviour be?
2019-01-15 + --01-15 = ?
2019-01-15
- same point (current behaviour)2020-01-15
- next matching point (what I think it should be)Need to investigate Cylc unit test failure with this branch
tests/unit/cycling/test_iso8601.py::test_cug - ValueError: Invalid month of year 1 or day of month None
Actually which should the behaviour be?
2019-01-15 + --01-15 = ?
2019-01-15
- same point (current behaviour)2020-01-15
- next matching point (what I think it should be)
I think we have to maintain the current behaviour to avoid breaking next()
in Cylc workflows - see https://github.com/cylc/cylc-flow/pull/5777
(Technically we could change the behaviour here and add a workaround in Cylc, but that's more effort)
Decision on 2019-01-15 + --01-15
(with greater clarity and precision):
The behaviour is to be:
2019-01-15T00:00:00 + --01-15
>>> 2019-01-15T00:00:00 # same datetime (we are exactly at midnight)
2019-01-15T00:00:01 + --01-15
>>> 2020-01-15T00:00:00 # next year
This is because a truncated datetime should assume 0 for any unspecified time units, and 1 for any unspecified date units lower than what has been specified.
No worries, this has not been a top priority at the moment
Closes #80 Closes #212
Built on #203