STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.model.param.Param Class Reference
Collaboration diagram for feedtwin.model.param.Param:
[legend]

Public Member Functions

None __post_init__ (self)
float si (self)
str dimension (self)
tuple[float, float]|None si_bounds (self)
Param replace (self, **Any changes)
dict[str, Any] to_dict (self)
Param from_dict (cls, dict[str, Any] data, str where="parameter")
str __str__ (self)

Public Attributes

 unit
 source
 value
 si

Static Public Attributes

str reference = ""
Uncertainty uncertainty = None

Detailed Description

One authored number, with its unit and its provenance.

The value is stored **as authored**, in the unit it was written in, and
converted on demand through :attr:`si`. Keeping the authored form is what
makes a config round-trip byte-identically: a file written in psi comes back
in psi rather than as a converted float with a trail of decimals.

Args:
    value: The number, in ``unit``.
    unit: A registered unit name -- see :mod:`feedtwin.model.units`.
    source: Where it came from. Required.
    reference: The document, test or reasoning behind it. Strongly
        encouraged; a ``MEASURED`` value with no reference is not traceable
        to anything and is only nominally better than a guess.
    uncertainty: How well it is known, if that is established.

Definition at line 106 of file param.py.

Member Function Documentation

◆ __post_init__()

None feedtwin.model.param.Param.__post_init__ ( self)

Definition at line 130 of file param.py.

◆ __str__()

str feedtwin.model.param.Param.__str__ ( self)

Definition at line 206 of file param.py.

References feedtwin.model.curve.Curve.reference, and reference.

◆ dimension()

str feedtwin.model.param.Param.dimension ( self)

Definition at line 144 of file param.py.

References unit.

◆ from_dict()

Param feedtwin.model.param.Param.from_dict ( cls,
dict[str, Any] data,
str where = "parameter" )

◆ replace()

Param feedtwin.model.param.Param.replace ( self,
**Any changes )
A copy with fields changed -- values are immutable by design.

Definition at line 153 of file param.py.

◆ si()

float feedtwin.model.param.Param.si ( self)
The value in this package's canonical unit for its dimension.

Definition at line 139 of file param.py.

◆ si_bounds()

tuple[float, float] | None feedtwin.model.param.Param.si_bounds ( self)
Uncertainty bounds in canonical units, or ``None`` if not stated.

Definition at line 147 of file param.py.

References uncertainty.

◆ to_dict()

dict[str, Any] feedtwin.model.param.Param.to_dict ( self)

Member Data Documentation

◆ reference

str feedtwin.model.param.Param.reference = ""
static

Definition at line 127 of file param.py.

Referenced by __str__(), and to_dict().

◆ si

feedtwin.model.param.Param.si

Definition at line 151 of file param.py.

◆ source

feedtwin.model.param.Param.source

Definition at line 132 of file param.py.

Referenced by to_dict().

◆ uncertainty

Uncertainty feedtwin.model.param.Param.uncertainty = None
static

Definition at line 128 of file param.py.

Referenced by si_bounds(), and to_dict().

◆ unit

feedtwin.model.param.Param.unit

Definition at line 131 of file param.py.

Referenced by dimension(), and to_dict().

◆ value


The documentation for this class was generated from the following file: