STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.model.spec.ComponentSpec Class Reference

Public Member Functions

None __post_init__ (self)
ParamSpec param (self, str name)
tuple[ParamSpec,...] params_for (self, str model)
dict[str, Param] validate (self, dict[str, Param] given, str model="")
dict[str, Curve] validate_curves (self, dict[str, Curve] given, str model="")
dict[str, str] validate_options (self, dict[str, str] given, str model="")
dict[str, Param] defaults (self, str model="")
dict[str, Any] to_dict (self)

Public Attributes

 type
 description

Static Public Attributes

tuple params = ()
tuple ports = ()
tuple states = ()
tuple curves = ()
tuple options = ()
tuple models = ("default",)

Static Protected Attributes

dict _by_name = field(default_factory=dict, repr=False)

Detailed Description

The complete declaration of one kind of component.

Definition at line 163 of file spec.py.

Member Function Documentation

◆ __post_init__()

◆ defaults()

dict[str, Param] feedtwin.model.spec.ComponentSpec.defaults ( self,
str model = "" )
Every defaulted parameter for a model. What a new instance starts as.

Definition at line 358 of file spec.py.

References feedtwin.model.curve.CurveSpec.models, models, feedtwin.model.spec.OptionSpec.models, feedtwin.model.spec.ParamSpec.models, and params_for().

◆ param()

ParamSpec feedtwin.model.spec.ComponentSpec.param ( self,
str name )

Definition at line 196 of file spec.py.

References _by_name.

◆ params_for()

tuple[ParamSpec, ...] feedtwin.model.spec.ComponentSpec.params_for ( self,
str model )
Parameters that apply to one fidelity model.

Definition at line 205 of file spec.py.

References feedtwin.comps.correlations.FittingContext.params, feedtwin.model.catalog.Part.params, feedtwin.model.component.ComponentInstance.params, and params.

Referenced by defaults().

◆ to_dict()

dict[str, Any] feedtwin.model.spec.ComponentSpec.to_dict ( self)
A plain-data description -- what the Phase 10 inspector consumes.

Definition at line 367 of file spec.py.

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().

◆ validate()

dict[str, Param] feedtwin.model.spec.ComponentSpec.validate ( self,
dict[str, Param] given,
str model = "" )
Check a configuration and return it with defaults filled in.

Every check that can be made without solving anything is made here, and
all failures are reported together rather than one per run -- fixing a
config six errors at a time beats six edit-run cycles.

Raises:
    SpecError: unknown or missing parameters, wrong dimensions, or
        values outside declared bounds.

Definition at line 209 of file spec.py.

References feedtwin.model.spec._bounds_problem(), _by_name, feedtwin.model.curve.CurveSpec.models, models, feedtwin.model.spec.OptionSpec.models, feedtwin.model.spec.ParamSpec.models, feedtwin.comps.correlations.FittingContext.params, feedtwin.model.catalog.Part.params, feedtwin.model.component.ComponentInstance.params, params, type, radio_link::Frame.type, radio_rx_t.type, and rec_t.type.

◆ validate_curves()

dict[str, Curve] feedtwin.model.spec.ComponentSpec.validate_curves ( self,
dict[str, Curve] given,
str model = "" )
Check tabulated data the same way scalars are checked.

Same three failures as :meth:`validate`: unknown name, missing when
required, wrong dimension on either axis. A Cv-versus-position curve
whose x axis is a pressure is exactly as wrong as a scalar bore in psi,
and should fail in the same place.

Definition at line 276 of file spec.py.

References actuator_testing_gui.ActuatorTestingWindow.curves, feedtwin.model.catalog.Part.curves, feedtwin.model.component.ComponentInstance.curves, curves, gui.App.curves, lc_calibration_gui.LCPlotWindow.curves, feedtwin.model.curve.CurveSpec.models, models, feedtwin.model.spec.OptionSpec.models, and feedtwin.model.spec.ParamSpec.models.

◆ validate_options()

dict[str, str] feedtwin.model.spec.ComponentSpec.validate_options ( self,
dict[str, str] given,
str model = "" )

Member Data Documentation

◆ _by_name

feedtwin.model.spec.ComponentSpec._by_name = field(default_factory=dict, repr=False)
staticprotected

Definition at line 174 of file spec.py.

Referenced by param(), and validate().

◆ curves

tuple feedtwin.model.spec.ComponentSpec.curves = ()
static

Definition at line 171 of file spec.py.

Referenced by __post_init__(), and validate_curves().

◆ description

feedtwin.model.spec.ComponentSpec.description

Definition at line 371 of file spec.py.

◆ models

feedtwin.model.spec.ComponentSpec.models = ("default",)
static

Definition at line 173 of file spec.py.

Referenced by __post_init__(), defaults(), validate(), validate_curves(), and validate_options().

◆ options

tuple feedtwin.model.spec.ComponentSpec.options = ()
static

Definition at line 172 of file spec.py.

Referenced by __post_init__(), and validate_options().

◆ params

◆ ports

tuple feedtwin.model.spec.ComponentSpec.ports = ()
static

Definition at line 169 of file spec.py.

◆ states

tuple feedtwin.model.spec.ComponentSpec.states = ()
static

Definition at line 170 of file spec.py.

◆ type


The documentation for this class was generated from the following file:
  • lib/feedtwin/feedtwin/model/spec.py