STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.model.param Namespace Reference

Classes

class  Provenance
class  Uncertainty
class  Param

Functions

dict[str, int] provenance_summary (dict[str, Param] params)
list[str] assumed_params (dict[str, Param] params)

Detailed Description

A parameter is a record, not a float.

Every number that describes hardware carries where it came from::

    Cv:
      value: 1.2
      unit: Cv
      source: manufacturer
      reference: "Swagelok SS-8BK-V51 datasheet rev C, table 2"
      uncertainty: {kind: relative, value: 0.10}

The value is the least interesting field. What makes a result trustworthy is
knowing which of its inputs were measured on the bench, which came off a
datasheet, and which somebody guessed on a Tuesday -- and today the answer to
that lives in people's heads and evaporates when they graduate.

There is no default for ``source``. Omitting it is a validation error, not a
shrug, because "we don't know where this came from" is exactly the state this
type exists to make impossible. ``DEFAULT`` is available and means something
specific: the library supplied it, and nobody has looked.

Provenance survives into results. A run report can say *this answer rests on
nine measured parameters, four datasheet values and two guesses* -- which is the
difference between a number you can defend in a design review and one you
cannot.

Function Documentation

◆ assumed_params()

list[str] feedtwin.model.param.assumed_params ( dict[str, Param] params)
Names of every parameter nobody has actually established, sorted.

What a report should list explicitly. A result standing on twelve guesses is
not wrong, but it is a different kind of claim from one standing on twelve
measurements, and the difference should never be invisible.

Definition at line 225 of file param.py.

◆ provenance_summary()

dict[str, int] feedtwin.model.param.provenance_summary ( dict[str, Param] params)
Count parameters by provenance -- the header of a run report.

Returns a mapping keyed by provenance value, always containing every key so
a report can render a stable table. ``{"measured": 9, "manufacturer": 4,
"estimated": 2, "default": 0}`` says more about how much to trust a result
than any single number in it.

Definition at line 211 of file param.py.