In [1]:
import burin
In [ ]:
In [ ]:
In [ ]:
Epoch files are config files which specify a set of options repeatedly on different date/times, represented by sections of the config file. When a value for an option for a given date is requested, the value in the last epoch (section) before the given date is returned.
All options do not need to be set in each epoch. Values are inherited from epoch to epoch in chronological order.
Epoch files have a specification for each option -- a type and default value.
In [6]:
%cat epochs_spec.cfg
In [5]:
%cat epochs.cfg
Specify an epoch parser with an epoch filename and the specification filename.
In [8]:
ep = burin.config.EpochParser('epochs.cfg', 'epochs_spec.cfg')
In [9]:
ep.is_valid()
Out[9]:
In [12]:
ep.get('cal_version', date='20180101')
Out[12]:
In [13]:
ep.get('cal_version', date='20180101.120000')
Out[13]:
In [ ]: