|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Public Member Functions | |
| ComponentInstance | build (cls, str id, str type_name, dict[str, Param] params, *, dict[str, Curve]|None curves=None, dict[str, str]|None options=None, str model="", dict[str, str]|None connections=None, str part="", Sequence[LineSegment]|None segments=None) |
| str | type (self) |
| str | option (self, str name) |
| float | si (self, str name) |
| dict[str, float] | si_params (self) |
| dict[str, int] | provenance (self) |
| list[str] | assumptions (self) |
| list[str] | unconnected_ports (self) |
| dict[str, Any] | to_dict (self) |
| ComponentInstance | from_dict (cls, Mapping[str, Any] data) |
| str | __str__ (self) |
Static Public Attributes | |
| dict | params [str, Param] |
| dict | curves = field(default_factory=dict) |
| dict | options = field(default_factory=dict) |
| dict | connections = field(default_factory=dict) |
| str | part = "" |
| tuple | segments = () |
One configured piece of hardware in a network.
Args:
id: Unique within a network -- ``"SOL-01"``, ``"PR-01"``. These are the
tags on the P&ID, deliberately, so a component in a simulation and
the same component on the drawing have the same name.
spec: Its declaration.
model: Which fidelity model to evaluate it at.
params: Validated parameters, defaults already filled in.
connections: Port name to network node id.
part: Catalog part number this was resolved from, if any. Kept for
traceability: it is how a report can say which physical valve a
result assumed.
Definition at line 117 of file component.py.
| str feedtwin.model.component.ComponentInstance.__str__ | ( | self | ) |
Definition at line 292 of file component.py.
| list[str] feedtwin.model.component.ComponentInstance.assumptions | ( | self | ) |
Parameters here that nobody has established. Worth reporting.
Definition at line 218 of file component.py.
References feedtwin.comps.correlations.FittingContext.params, feedtwin.model.catalog.Part.params, and params.
| ComponentInstance feedtwin.model.component.ComponentInstance.build | ( | cls, | |
| str | id, | ||
| str | type_name, | ||
| dict[str, Param] | params, | ||
| * | , | ||
| dict[str, Curve] | None | curves = None, | ||
| dict[str, str] | None | options = None, | ||
| str | model = "", | ||
| dict[str, str] | None | connections = None, | ||
| str | part = "", | ||
| Sequence[LineSegment] | None | segments = None ) |
Validate a configuration and produce an instance from it. The only supported way to make one: it runs the spec's validation, so an instance that exists is one whose parameters are complete, dimensionally sound and within bounds.
Definition at line 153 of file component.py.
Referenced by from_dict().
| ComponentInstance feedtwin.model.component.ComponentInstance.from_dict | ( | cls, | |
| Mapping[str, Any] | data ) |
Definition at line 257 of file component.py.
References build().
Referenced by engine.control.robust_ddp.data_models.ControllerConfig.from_json(), engine.control.robust_ddp.data_models.ControllerConfig.from_yaml(), and calibration_robustness.SystemConfig.load().
| str feedtwin.model.component.ComponentInstance.option | ( | self, | |
| str | name ) |
One categorical choice, defaults already resolved.
Definition at line 190 of file component.py.
References options.
| dict[str, int] feedtwin.model.component.ComponentInstance.provenance | ( | self | ) |
How many of this component's parameters came from where.
Definition at line 214 of file component.py.
References feedtwin.comps.correlations.FittingContext.params, feedtwin.model.catalog.Part.params, and params.
| float feedtwin.model.component.ComponentInstance.si | ( | self, | |
| str | name ) |
One parameter as a plain float in canonical units.
Definition at line 200 of file component.py.
References feedtwin.comps.correlations.FittingContext.params, feedtwin.model.catalog.Part.params, and params.
| dict[str, float] feedtwin.model.component.ComponentInstance.si_params | ( | self | ) |
Every parameter as plain floats -- what a component resolves once.
Definition at line 210 of file component.py.
References feedtwin.comps.correlations.FittingContext.params, feedtwin.model.catalog.Part.params, and params.
| dict[str, Any] feedtwin.model.component.ComponentInstance.to_dict | ( | self | ) |
Definition at line 237 of file component.py.
References connections, actuator_testing_gui.ActuatorTestingWindow.curves, feedtwin.model.catalog.Part.curves, curves, gui.App.curves, lc_calibration_gui.LCPlotWindow.curves, _USBD_HandleTypeDef.id, anonymous_namespace{config_broadcast_service_main.cpp}::BoardInfo.id, anonymous_namespace{idle_e2e.cpp}::Check.id, backend.routers.layerx.Job.id, check_t.id, detail::exception.id, engine.layerx.sources.Drawing.id, feedtwin.comps.base.HydraulicComponent.id(), feedtwin.comps.elements.OrificeISO5167.id, feedtwin.comps.gas.GasOrifice.id, feedtwin.comps.manifold.Manifold.id, feedtwin.comps.regulator.Regulator.id, feedtwin.comps.relief.ReliefValve.id, feedtwin.engine.component.InjectorLeg.id, feedtwin.engine.component.InjectorLeg.id(), feedtwin.session.core.Session.id, feedtwin.session.hookup.Knob.id, fsw::config::StateDef.id, engine.layerx.prepare.Prepared.model, engine.pipeline.config_schemas.CombustionEfficiencyConfig.model, engine.pipeline.config_schemas.EvaporationConfig.model, engine.pipeline.config_schemas.SMDConfig.model, engine.pipeline.config_schemas.SprayAngleConfig.model, engine.pipeline.stability.timelag.LagBreakdown.model, engine.pipeline.vehicle_drag.DragCurves.model, feedtwin.comps.relief.ReliefValve.model(), feedtwin.session.core.Session.model, options, feedtwin.comps.correlations.FittingContext.params, feedtwin.model.catalog.Part.params, params, part, anonymous_namespace{config_broadcast_service_main.cpp}::BoardInfo.type, backend.routers.timeseries.PressureSegment.type, basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass >.type, basic_json< nlohmann::ordered_map >.type, BoardConfig.type, default_value_traits.type, engine.pipeline.config_schemas.CoaxialInjectorConfig.type, engine.pipeline.config_schemas.ImpingingInjectorConfig.type, engine.pipeline.config_schemas.InjectorBaseConfig.type, engine.pipeline.config_schemas.PintleInjectorConfig.type, engine.pipeline.config_schemas.PressureSegmentConfig.type, feedtwin.comps.base.HydraulicComponent.type(), type(), feedtwin.model.spec.ComponentSpec.type, float_traits_base< T, MantissaDigits, DecimalDigits >.type, fsw::config::BoardConfig.type, fsw::control::RobustDDPController::Command.type, fsw::control::RobustDDPController::Reference.type, integer_traits_base< T >.type, native_value_traits< T, NodeType >.type, radio_link::Frame.type, radio_rx_t.type, rec_t.type, and string_traits< T >.type.
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().
| str feedtwin.model.component.ComponentInstance.type | ( | self | ) |
Definition at line 187 of file component.py.
Referenced by feedtwin.pid.document.PidNode.is_annotation(), feedtwin.pid.document.PidNode.is_inline(), feedtwin.pid.document.PidNode.is_instrument(), feedtwin.pid.document.PidNode.is_source(), feedtwin.model.catalog.Part.to_dict(), and to_dict().
| list[str] feedtwin.model.component.ComponentInstance.unconnected_ports | ( | self | ) |
Fluid ports with nothing attached. Not an error on its own -- a network under construction has plenty -- but a dead end at solve time is a singular system, and naming it here is far kinder than a linear-algebra failure later.
Definition at line 222 of file component.py.
References connections.
|
static |
Definition at line 139 of file component.py.
Referenced by to_dict(), and unconnected_ports().
|
static |
Definition at line 137 of file component.py.
Referenced by feedtwin.model.spec.ComponentSpec.__post_init__(), to_dict(), and feedtwin.model.spec.ComponentSpec.validate_curves().
|
static |
Definition at line 138 of file component.py.
Referenced by feedtwin.model.spec.ComponentSpec.__post_init__(), option(), to_dict(), and feedtwin.model.spec.ComponentSpec.validate_options().
|
static |
Definition at line 136 of file component.py.
Referenced by feedtwin.model.spec.ComponentSpec.__post_init__(), assumptions(), feedtwin.model.spec.ComponentSpec.params_for(), provenance(), si(), si_params(), test_robust_ddp_dynamics.TestDynamics.test_blowdown_decreases_pressure(), test_robust_ddp_dynamics.TestDynamics.test_control_clamping(), test_robust_ddp_dynamics.TestDynamics.test_copv_blowdown(), test_robust_ddp_dynamics.TestDynamics.test_feed_pressure_lag(), test_robust_ddp_ddp_solver.TestDDPSolver.test_forward_rollout(), test_robust_ddp_dynamics.TestDynamics.test_linearize_accuracy(), test_robust_ddp_dynamics.TestDynamics.test_linearize_shape(), test_robust_ddp_dynamics.TestDynamics.test_pressurization_increases_pressure(), test_robust_ddp_dynamics.TestDynamics.test_state_non_negative(), test_robust_ddp_dynamics.TestDynamics.test_step_basic(), test_robust_ddp_robustness.TestRobustness.test_tube_propagate_basic(), test_robust_ddp_robustness.TestRobustness.test_tube_propagate_validation(), test_robust_ddp_robustness.TestRobustness.test_tube_propagate_widens(), test_robust_ddp_robustness.TestRobustness.test_tube_propagate_with_large_w_bar(), test_robust_ddp_dynamics.TestDynamics.test_ullage_volume_increases(), test_robust_ddp_dynamics.TestDynamics.test_zero_mass_flow(), to_dict(), and feedtwin.model.spec.ComponentSpec.validate().
|
static |
Definition at line 140 of file component.py.
Referenced by to_dict().
|
static |
Definition at line 141 of file component.py.
Referenced by feedtwin.model.segments.LineLoss.__bool__(), feedtwin.model.segments.LineLoss.__len__(), feedtwin.model.segments.LineLoss.method(), and feedtwin.model.segments.LineLoss.weakest_method().