Skip to content

Commit 2e106b4

Browse files
committed
removed variant_name from the example class ModelVariables. This is more a parameter than a variable.
1 parent f6d69de commit 2e106b4

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

larray/core/checked.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ class CheckedSession(Session, AbstractCheckedSession, metaclass=ModelMetaclass):
252252
>>> class ModelVariables(CheckedSession):
253253
... # --- declare variables with defined types ---
254254
... # Their values will be defined at runtime but must match the specified type.
255-
... variant_name: str
256255
... birth_rate: Array
257256
... births: Array
258257
... # --- declare variables with a default value ---
@@ -271,12 +270,9 @@ class CheckedSession(Session, AbstractCheckedSession, metaclass=ModelMetaclass):
271270
>>> variant_name = "baseline"
272271
>>> # Instantiation --> create an instance of the ModelVariables class.
273272
>>> # Warning: All variables declared without a default value must be set.
274-
>>> m = ModelVariables(
275-
... variant_name = variant_name,
276-
... birth_rate = zeros((AGE, GENDER)),
277-
... births = zeros((AGE, GENDER, TIME), dtype=int),
278-
... mortality_rate = 0,
279-
... )
273+
>>> m = ModelVariables(birth_rate = zeros((AGE, GENDER)),
274+
... births = zeros((AGE, GENDER, TIME), dtype=int),
275+
... mortality_rate = 0)
280276
281277
>>> # ==== model ====
282278
>>> # In the definition of ModelVariables, the 'birth_rate' variable, has been declared as an Array object.
@@ -354,7 +350,6 @@ class CheckedSession(Session, AbstractCheckedSession, metaclass=ModelMetaclass):
354350
>>> # ==== output ====
355351
>>> # save all variables in an HDF5 file
356352
>>> m.save(f'{variant_name}.h5', display=True)
357-
dumping variant_name ... done
358353
dumping birth_rate ... done
359354
dumping births ... done
360355
dumping mortality_rate ... done

0 commit comments

Comments
 (0)