ecflow.RepeatDateTimeList

class ecflow.RepeatDateTimeList

Bases: pybind11_object

Allows a node to be repeated using an arbitrary list of date+time instants (yyyymmddTHHMMSS format).

A node can only have one repeat. The repeat name can be referenced in trigger expressions.

Constructor:

RepeatDateTimeList(variable, list)
   string variable:          The name of the repeat. The current datetime can be referenced in
                             trigger expressions using the variable name
   list list_of_str:         Arbitrary list of datetime strings in yyyymmddTHHMMSS format

Exception:

  • Throws a RuntimeError if any string is not a valid datetime

Usage:

rep = RepeatDateTimeList('DT', ['20240101T000000', '20240102T120000', '20240103T060000'])
t = Task('t1',
         RepeatDateTimeList('DT', ['20240101T000000', '20240102T120000']))

Accessor methods:

current_index() -> int
   Zero-based index of the current instant in the list.
current_value() -> str
   The current instant as a string in yyyymmddTHHMMSS format, or '' if out of bounds.
RepeatDateTimeList.current_index(self: ecflow.RepeatDateTimeList) int

Return the zero-based index of the current instant in the list.

RepeatDateTimeList.current_value(self: ecflow.RepeatDateTimeList) object

Return the current instant as a string in yyyymmddTHHMMSS format.

RepeatDateTimeList.end(self: ecflow.RepeatDateTimeList) int

Return the end instant as seconds since epoch

RepeatDateTimeList.name(self: ecflow.RepeatDateTimeList) str

Return the name of the repeat.

RepeatDateTimeList.start(self: ecflow.RepeatDateTimeList) int

Return the start instant as seconds since epoch