|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Public Member Functions | |
| None | __init__ (self, Iterable[Part] parts=()) |
| int | __len__ (self) |
| bool | __contains__ (self, object part_id) |
| Part | add (self, Part part) |
| Part | get (self, str part_id) |
| list[str] | parts (self, str|None type_name=None) |
| list[Part] | load (self, Path|str path) |
| Catalog | from_file (cls, Path|str path) |
| ComponentInstance | instantiate (self, str instance_id, str part_id, *, Mapping[str, Param]|None overrides=None, Mapping[str, Curve]|None curves=None, str model="", Mapping[str, str]|None connections=None) |
| dict[str, Any] | to_dict (self) |
Protected Attributes | |
| dict | _parts = {p.id: p for p in parts} |
A collection of parts, loadable from one or more TOML files. Layering is by design: a shipped catalog, a team catalog and a campaign-specific one can all be loaded in order, with later definitions replacing earlier ones by part number.
Definition at line 140 of file catalog.py.
| None feedtwin.model.catalog.Catalog.__init__ | ( | self, | |
| Iterable[Part] | parts = () ) |
Definition at line 148 of file catalog.py.
| bool feedtwin.model.catalog.Catalog.__contains__ | ( | self, | |
| object | part_id ) |
Definition at line 154 of file catalog.py.
References _parts.
| int feedtwin.model.catalog.Catalog.__len__ | ( | self | ) |
Definition at line 151 of file catalog.py.
References _parts.
Definition at line 157 of file catalog.py.
References _parts.
Referenced by feed_line_K.Run.ball_valve_full_bore(), feed_line_K.Run.contraction(), feed_line_K.Run.entrance(), feed_line_K.Run.expansion(), load(), and feed_line_K.Run.straight().
| Catalog feedtwin.model.catalog.Catalog.from_file | ( | cls, | |
| Path | str | path ) |
Definition at line 190 of file catalog.py.
| Part feedtwin.model.catalog.Catalog.get | ( | self, | |
| str | part_id ) |
| ComponentInstance feedtwin.model.catalog.Catalog.instantiate | ( | self, | |
| str | instance_id, | ||
| str | part_id, | ||
| * | , | ||
| Mapping[str, Param] | None | overrides = None, | ||
| Mapping[str, Curve] | None | curves = None, | ||
| str | model = "", | ||
| Mapping[str, str] | None | connections = None ) |
Turn a part number into a configured component. Precedence, lowest to highest: datasheet values, then measurements, then anything given in ``overrides``. Curves layer the same way, the part's beneath anything passed in. An override is how a single instance differs from its catalogue entry -- this particular valve was trimmed, this run of tube is longer -- without inventing a new part number. The result is validated against the component's spec, so a catalog entry missing a required parameter fails here with the parameter named, rather than at solve time as a missing key.
Definition at line 195 of file catalog.py.
References AdcLayout.get(), feedtwin.comps.correlations.FittingContext.get(), and get().
| list[Part] feedtwin.model.catalog.Catalog.load | ( | self, | |
| Path | str | path ) |
Load a TOML catalog file, replacing any parts it redefines.
Definition at line 174 of file catalog.py.
References add().
Referenced by engine.layerx.measurements.MeasurementStore.get().
| list[str] feedtwin.model.catalog.Catalog.parts | ( | self, | |
| str | None | type_name = None ) |
Part numbers, optionally filtered by component type.
Definition at line 170 of file catalog.py.
References _parts.
| dict[str, Any] feedtwin.model.catalog.Catalog.to_dict | ( | self | ) |
Definition at line 234 of file catalog.py.
References _parts.
Referenced by calibration_robustness.SystemConfig.save(), engine.control.robust_ddp.data_models.ControllerConfig.to_json(), and engine.control.robust_ddp.data_models.ControllerConfig.to_yaml().
Definition at line 149 of file catalog.py.
Referenced by __contains__(), __len__(), add(), get(), parts(), and to_dict().