sid.time

This module contains functions for handling sid’s internal period.

sid’s internal period is similar to Unix time, but the reference date is 2019-01-01 instead of 1970-01-01 and it is not measured in seconds but days. This allows to use a int16 instead of int32 for Unix time.

The internal period is used to store dates more efficiently as a int16 instead of the normal datetime64.

The advantage of this approach over enumerating periods passed via the duration argument of get_simulate_func() is that there is still information on the exact dates in the states even if the "date" column is removed during estimation to reduce memory consumption.

Module Contents

Functions

period_to_timestamp(period, relative_to)

timestamp_to_period(timestamp, relative_to)

get_date(states)

Get date from states.

Attributes

period_to_timestamp(period, relative_to)[source]
timestamp_to_period(timestamp, relative_to)[source]
sid_period_to_timestamp[source]
timestamp_to_sid_period[source]
get_date(states)[source]

Get date from states.