smif.metadata.timestep module

smif runs models over a series of planning timesteps.

RelativeTimestep is used to specify one timestep relative to another in the context of the set of planning timesteps.

For example, if a model needs to know its own outputs from a previous year, we can specify the self-dependency using a relative timestep.

Summary

Data:

RelativeTimestep Specify current, previous or base year timestep
element_before Return the element before a given element in a list, or None if the given element is first or not in the list.

Reference

class smif.metadata.timestep.RelativeTimestep[source]

Bases: enum.Enum

Specify current, previous or base year timestep

CURRENT = 'CURRENT'
PREVIOUS = 'PREVIOUS'
BASE = 'BASE'
ALL = 'ALL'
from_name = <bound method RelativeTimestep.from_name of <enum 'RelativeTimestep'>>[source]
resolve_relative_to(timestep: int, timesteps: List[int]) → Union[None, int][source]

Resolve a relative timestep with respect to a given timestep and sequence of timesteps.

Parameters:
  • timestep (int) –
  • timesteps (list of int) –
smif.metadata.timestep.element_before(element: int, list_: List[int]) → int[source]

Return the element before a given element in a list, or None if the given element is first or not in the list.