TimeFrame

time.TimeFrame(self, start_date, duration_days)

The time frame of a simulation.

Examples

from datetime import date

from epymorph.time import TimeFrame

# For your convenience, there are a number of ways to construct TimeFrames:

# 1. Start January 1st, 2020 and go for 150 days
TimeFrame(date(2020, 1, 1), 150)

# 2. Equivalent, but accept dates as ISO-8601 strings
TimeFrame.of("2020-01-01", 150)

# 3. January through March 2020
TimeFrame.range("2020-01-01", "2020-03-31")

# 4. Equivalent, but using an exclusive endpoint
TimeFrame.rangex("2020-01-01", "2020-04-01")

# 5. The whole of 2020
TimeFrame.year(2020)

Attributes

start_date: date

The first date in the simulation.

duration_days: int

The number of days for which to run the simulation.

end_date: date

The last date included in the simulation.

select: TimeSelector

Create a time-axis strategy from this time frame.

In most cases, this will be used to process a simulation result and so you should use a selection on the time frame used in the RUME that produced the result.