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

Classes:

RelativeTimestep Specify current, previous or base year timestep

Functions:

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, timesteps)[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, list_)[source]

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