-
Notifications
You must be signed in to change notification settings - Fork 94
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
#976: advanced dependencies #1044
#976: advanced dependencies #1044
Conversation
…dvanced-dependencies
…dvanced-dependencies
…dvanced-dependencies
There is still the murky problem of people writing future-trigger-chains like this:
where the dependency on |
else: | ||
return base_point + interval | ||
return ISO8601Point(str( | ||
abbrev_util.parse_timepoint( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be SuiteSpecifics.abbrev_util
?
Can you explain this? |
What I really mean is that, in config.py:
and in taskdef.py:
can't be done with varying (irregular) offsets like To get the maximum intercycle offset for a taskdef, you might well For example, the
|
Ah, ok, thanks. I had not read very carefully and was interpreting [20T-P2W] as [P20T-P2W], which is just arithmetic to get a normal static interval. [edit: except that my version seems not to be valid anyway] |
I think this is ok, but I haven't fully understood it yet (and it's getting late here now...). Is there a plausible use case for this sort of offset though, other than "if it's possible someone will try it". |
I think @arjclark knows of a climate suite that wants "01T-P1D" to get the last day of the month |
dependent_point = sequence.get_start_point() | ||
|
||
matching_dependent_points = [] | ||
while dependent_point is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop worries me - it will typically start from suite initial cycle point and iterate the sequence all the way to my_point plus offset, so for a very long running suite this will get slower and slower won't it? I tested this by restarting a small suite with an irregular offset after editing the state file to make it look as if it had been running for years. Is it possible to jump onto the sequence close to my_point and go from there?
Actually, we're doing this kind of thing in a number places, no? In the old cyclers I was able to compute the difference between my_point and the sequence-start-point, and if the result was not a multiple of the sequence interval, adjust my_point by the remainder to get to the on-sequence point nearest to my_point. Is this not possible in the general ISO8601 case? |
I think it is probably possible - I'll try and think of a way to do it! |
Sweet - I'll merge (as the task-specific calculation clearly is otherwise necessary to handle irregular intervals), and raise a new issue for this. |
I do indeed, and I can see this behaviour becoming quite important for them. |
This closes #976 by adding a complex dependency test and adding
the code to make it work.
The test contains statements like:
The parsing and processing of things like
20T-P2W
was already done in thetime_parser.py for recurrence statements, but can now be done via a
convenient
get_point_relative
call.The major issue is that with statements like
foo[20T-P2W] => bar
, it is nolonger possible to figure out a cleanup cutoff or a future trigger offset that
is universally valid for all points on the sequence. This now has to be done
for each task instance in
taskdef.py
. For standard, simple offsets like[-PT6H]
, the behaviour is pretty much the same.The new future trigger runahead treatment has the nice property of being
adaptive based on the current active tasks.
@hjoliver, please review.