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

Classes

class  CatalogError
class  Part
class  Catalog

Functions

dict[str, Curve] _curves (str part_id, Any raw)
dict[str, Param] _params (str part_id, Any raw, str block)
Param measured (float value, str unit, str reference, Any uncertainty=None)

Detailed Description

The parts database: real hardware, with the datasheet and what we measured.

A catalog entry is a part number and the parameters that describe it. Two sets
of them, deliberately kept apart::

    [swagelok-ss-8bk-v51]
    type = "valve"
    manufacturer = "Swagelok"

    [swagelok-ss-8bk-v51.params.Cv]
    value = 1.2
    unit = "Cv"
    source = "manufacturer"
    reference = "SS-8BK-V51 datasheet rev C, table 2"

    [swagelok-ss-8bk-v51.measured.Cv]
    value = 1.14
    unit = "Cv"
    source = "measured"
    reference = "CF-2026-03, 12 points, R^2 0.998"

:meth:`Part.resolve` merges them with the measurement winning. The datasheet
value is *not* overwritten -- it stays visible, so "the valve flows 5% under
its rating" is a question anyone can ask later. Overwriting would destroy the
only record that the discrepancy exists.

This is where Phase 12 writes back: fitting parameters against a cold-flow
produces ``measured`` blocks, with the test that produced them in ``reference``.
Building the shape now means that phase adds data, not plumbing.

Function Documentation

◆ _curves()

dict[str, Curve] feedtwin.model.catalog._curves ( str part_id,
Any raw )
protected

Definition at line 122 of file catalog.py.

Referenced by feedtwin.model.catalog.Part.from_dict().

◆ _params()

dict[str, Param] feedtwin.model.catalog._params ( str part_id,
Any raw,
str block )
protected

Definition at line 131 of file catalog.py.

Referenced by feedtwin.model.catalog.Part.from_dict().

◆ measured()

Param feedtwin.model.catalog.measured ( float value,
str unit,
str reference,
Any uncertainty = None )
A measured value, tagged as such. Shorthand for Phase 12 write-back.

Definition at line 238 of file catalog.py.