ecflow.Clock

class ecflow.Clock

Bases: pybind11_object

Specifies the clock type used by the suite.

Only suites can have a clock. A gain can be specified to offset from the given date.

Constructor:

Clock(day,month,year,hybrid)
   int day              : Specifies the day of the month  1-31
   int month            : Specifies the month 1-12
   int year             : Specifies the year > 1400
   bool hybrid<optional>: Default = False, true means hybrid, false means real
                          by default the clock is not real

   Time will be set to midnight, use set_gain() to alter

Clock(hybrid)
   bool hybrid: true means hybrid, false means real
                by default the clock is real
   Time will be set real time of the computer

Exceptions:

  • raises IndexError when an invalid Clock is specified

Usage:

suite = Suite('s1')
clock = Clock(1,1,2012,False)
clock.set_gain(1,10,True)
suite.add_clock(clock)
Clock.day(self: ecflow.Clock) int

Returns the day as an integer, range 1-31

Clock.gain(self: ecflow.Clock) int

Returns the gain as an long. This represents seconds

Clock.month(self: ecflow.Clock) int

Returns the month as an integer, range 1-12

Clock.positive_gain(self: ecflow.Clock) bool

Returns a boolean, where true means that the gain is positive

Clock.set_gain(self: ecflow.Clock, arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex, arg2: bool) None

Set the gain in hours and minutes

Clock.set_gain_in_seconds(self: ecflow.Clock, arg0: SupportsInt | SupportsIndex, arg1: bool) None

Set the gain in seconds

Clock.year(self: ecflow.Clock) int

Returns the year as an integer, > 1400