iode.Variables.sample

Variables.sample

sample: Sample

Current sample of the IODE Variables database.

Parameters:
value: str or tuple(str, str)

New sample as string ‘start_period:last_period’ or as a tuple ‘start_period’, ‘last_period’.

Examples

>>> from iode import SAMPLE_DATA_DIR
>>> from iode import variables
>>> variables.load(f"{SAMPLE_DATA_DIR}/fun.var")
>>> variables.sample
'1960Y1:2015Y1'
>>> # update sample by passing a string
>>> variables.sample = '1970Y1:2020Y1'
>>> variables.sample
'1970Y1:2020Y1'
>>> # start or end period are optional
>>> variables.sample = ':2010Y1'
>>> variables.sample
'1970Y1:2010Y1'
>>> variables.sample = '1980Y1:'
>>> variables.sample
'1980Y1:2010Y1'
>>> # update sample by passing a start period and 
>>> # an end period separated by a comma
>>> variables.sample = '1980Y1', '2010Y1'
>>> variables.sample
'1980Y1:2010Y1'