@@ -20,7 +20,7 @@ def __init__(self, variable, population):
2020 self .population = population
2121 self .variable = variable
2222 self .simulation = population .simulation
23- self ._memory_storage = InMemoryStorage (is_eternal = (self .variable .definition_period == DateUnit .Eternity ))
23+ self ._memory_storage = InMemoryStorage (is_eternal = (self .variable .definition_period == DateUnit .ETERNITY ))
2424
2525 # By default, do not activate on-disk storage, or variable dropping
2626 self ._disk_storage = None
@@ -57,7 +57,7 @@ def create_disk_storage(self, directory = None, preserve = False):
5757 os .mkdir (storage_dir )
5858 return OnDiskStorage (
5959 storage_dir ,
60- is_eternal = (self .variable .definition_period == DateUnit .Eternity ),
60+ is_eternal = (self .variable .definition_period == DateUnit .ETERNITY ),
6161 preserve_storage_dir = preserve
6262 )
6363
@@ -149,13 +149,13 @@ def set_input(self, period, array):
149149 """
150150
151151 period = periods .period (period )
152- if period .unit == DateUnit .Eternity and self .variable .definition_period != DateUnit .Eternity :
152+ if period .unit == DateUnit .ETERNITY and self .variable .definition_period != DateUnit .ETERNITY :
153153 error_message = os .linesep .join ([
154154 'Unable to set a value for variable {0} for {1}.' ,
155155 '{0} is only defined for {2}s. Please adapt your input.' ,
156156 ]).format (
157157 self .variable .name ,
158- DateUnit .Eternity ,
158+ DateUnit .ETERNITY ,
159159 self .variable .definition_period ,
160160 )
161161 raise PeriodMismatchError (
@@ -199,9 +199,9 @@ def _to_array(self, value):
199199
200200 def _set (self , period , value ):
201201 value = self ._to_array (value )
202- if self .variable .definition_period != DateUnit .Eternity :
202+ if self .variable .definition_period != DateUnit .ETERNITY :
203203 if period is None :
204- raise ValueError (f'A period must be specified to set values, except for variables with { DateUnit .Eternity } as as period_definition.' )
204+ raise ValueError (f'A period must be specified to set values, except for variables with { DateUnit .ETERNITY } as as period_definition.' )
205205 if (self .variable .definition_period != period .unit or period .size > 1 ):
206206 name = self .variable .name
207207 period_size_adj = f'{ period .unit } ' if (period .size == 1 ) else f'{ period .size } -{ period .unit } s'
0 commit comments