Skip to content

Commit f6d69de

Browse files
committed
renamed class Parameters as CheckedParameters
1 parent b87d347 commit f6d69de

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

doc/source/api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,13 +836,13 @@ CheckedSession
836836

837837
CheckedSession
838838

839-
Parameters
840-
==========
839+
CheckedParameters
840+
=================
841841

842842
.. autosummary::
843843
:toctree: _generated/
844844

845-
Parameters
845+
CheckedParameters
846846

847847
.. _api-editor:
848848

larray/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
eye, all, any, sum, prod, cumsum, cumprod, min, max, mean, ptp, var,
99
std, median, percentile, stack, zip_array_values, zip_array_items)
1010
from larray.core.session import Session, local_arrays, global_arrays, arrays
11-
from larray.core.checked import CheckedArray, CheckedSession, Parameters
11+
from larray.core.checked import CheckedArray, CheckedSession, CheckedParameters
1212
from larray.core.constants import nan, inf, pi, e, euler_gamma
1313
from larray.core.metadata import Metadata
1414
from larray.core.ufuncs import wrap_elementwise_array_func, maximum, minimum, where
@@ -60,7 +60,7 @@
6060
# session
6161
'Session', 'local_arrays', 'global_arrays', 'arrays',
6262
# constrained
63-
'CheckedArray', 'CheckedSession', 'Parameters',
63+
'CheckedArray', 'CheckedSession', 'CheckedParameters',
6464
# constants
6565
'nan', 'inf', 'pi', 'e', 'euler_gamma',
6666
# metadata

larray/core/checked.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class CheckedSession(Session, AbstractCheckedSession, metaclass=ModelMetaclass):
233233
234234
See Also
235235
--------
236-
Session, Parameters
236+
Session, CheckedParameters
237237
238238
Examples
239239
--------
@@ -467,7 +467,7 @@ def dict(self, exclude: Set[str] = None):
467467
del d[name]
468468
return d
469469

470-
class Parameters(CheckedSession):
470+
class CheckedParameters(CheckedSession):
471471
"""
472472
Same as py:class:`CheckedSession` but declared variables cannot be modified after initialization.
473473
@@ -493,7 +493,7 @@ class Parameters(CheckedSession):
493493
Content of file 'parameters.py'
494494
495495
>>> from larray import *
496-
>>> class ModelParameters(Parameters):
496+
>>> class Parameters(CheckedParameters):
497497
... # --- declare variables with fixed values ---
498498
... # The given values can never be changed
499499
... FIRST_YEAR = 2020
@@ -509,14 +509,14 @@ class Parameters(CheckedSession):
509509
510510
>>> # instantiation --> create an instance of the ModelVariables class
511511
>>> # all variables declared without value must be set
512-
>>> P = ModelParameters(variant_name='variant_1')
512+
>>> P = Parameters(variant_name='variant_1')
513513
>>> # once an instance is create, its variables can be accessed but not modified
514514
>>> P.variant_name
515515
'variant_1'
516516
>>> P.variant_name = 'new_variant' # doctest: +NORMALIZE_WHITESPACE
517517
Traceback (most recent call last):
518518
...
519-
TypeError: Cannot change the value of the variable 'variant_name' since 'ModelParameters'
519+
TypeError: Cannot change the value of the variable 'variant_name' since 'Parameters'
520520
is immutable and does not support item assignment
521521
"""
522522
class Config:
@@ -533,7 +533,7 @@ def __init__(self, *args, **kwargs):
533533
raise NotImplementedError("CheckedSession class cannot be instantiated "
534534
"because pydantic is not installed")
535535

536-
class Parameters(object):
536+
class CheckedParameters(object):
537537
def __init__(self, *args, **kwargs):
538-
raise NotImplementedError("Parameters class cannot be instantiated "
538+
raise NotImplementedError("CheckedParameters class cannot be instantiated "
539539
"because pydantic is not installed")

0 commit comments

Comments
 (0)