Parameters#
jeanspy.model.Parameters
See methods and properties for individual lookup pages, or the alphabetical API dictionary to search all classes. The full class contract and existing member anchors are retained below.
- class jeanspy.model.Parameters(data=None, **kw)#
Bases:
collections.abc.MutableMappingLightweight mapping used for stateful model parameters.
The container supports attribute access, conversion to
pandas.Series, and predictable shallow/deep copy semantics.Notes
Inputs and units. An optional mapping plus keyword values; keys are strings and units belong to the stored values.
Returns and shape. Parameters.copy is shallow; deepcopy separates nested values. Parameters.index and .values are lists, not NumPy arrays or dict methods;
to_seriesreturns a pandas Series. Attribute assignment updates the named parameter.Validity. Container operations have no physical validation.
Errors. Missing mapping keys raise KeyError; missing attributes raise AttributeError.
Backend. Python host-side containers.
Differentiation. No physical-parameter automatic differentiation on this API.
Examples
>>> from jeanspy.model import Parameters >>> float(Parameters({"re_pc": 300.}).to_series()["re_pc"]) 300.0
- Parameters:
data (Optional[Mapping[str, Any]])
kw (Any)
- clear() None. Remove all items from D.#
- copy()[source]#
Make a shallow parameter copy.
Notes
Inputs and units. No arguments.
Returns and shape. New Parameters mapping; nested mutable values remain shared. Use copy.deepcopy for them.
- Return type:
- get(k[, d]) D[k] if k in D, else d. d defaults to None.#
- property index#
Return parameter names as an insertion-ordered list of strings.
- items() a set-like object providing a view on D's items#
- keys() a set-like object providing a view on D's keys#
- pop(k[, d]) v, remove specified key and return the corresponding value.#
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair#
as a 2-tuple; but raise KeyError if D is empty.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D#
- to_series()[source]#
Convert parameter storage to a pandas Series.
Notes
Inputs and units. No arguments.
Returns and shape. Series named params, preserving key order; values keep their original units.
- Return type:
pandas.Series
- update(other, **kw)[source]#
Merge a mapping, Parameters or Series, then keyword replacements.
Returns None. Values retain their units and are not deep-copied or physically validated; later entries replace existing keys.
- Parameters:
other (Mapping[str, Any] | jeanspy.model.Parameters | pandas.Series)
kw (Any)
- Return type:
None
- property values#
Return stored values as an insertion-ordered list, retaining their units.