Grand-tour subject¶
The module needs no extra. The grand tour (tutorial 9) uses it.
The subject of the grand tour: one mission architecture and its preset.
A subject is one mission architecture. It names a mission (a key of
longeron.analysis.dashboard.DEFAULT_MISSIONS), one variant of the
mission’s airframe variation point, one variant for each remaining
variation point, and a set of transient attribute overrides. A bare
airframe is never a subject, because the subject parameter of a mission
requirement is a MissionUAV.
The module has three pure functions over the model and the trade study
(longeron.analysis.trades). No function creates a widget.
preset()pins the airframe and picks the trade study’s best selection for it. A verified mix is a mix that violates none of the mission’s constraints. The preset is the verified mix with the largest mission metric. If the airframe has no verified mix, the preset is the mix with the fewest violations, andPreset.basissays so.craft_variant()maps a clicked definition to its airframe variant. A build configuration such asRotorcraft::QuadCopteris not a catalog airframe, so it maps toNone.requirement_set()pairs each requirement definition, and each requirement usage that a package owns, with the first instance of the subject where the requirement applies. The interpreter decides conformance to the subject parameter and applicability.
- longeron.analysis.subject.MissionName¶
the keys of
DEFAULT_MISSIONS, one per mission context ofScoutMissions(a test keeps the two equal)alias of
Literal[‘ISR’, ‘logistics’, ‘intercept’]
- class longeron.analysis.subject.Preset(architecture, basis)[source]¶
Bases:
objectThe trade study’s selection for one airframe in one mission.
- architecture: Architecture¶
the chosen mix, its metrics and violations
- longeron.analysis.subject.PresetBasis¶
how
preset()chose its mix:"verified"is the best verified mix,"fewest_violations"is the fallback for an airframe with no verified mixalias of
Literal[‘verified’, ‘fewest_violations’]
- class longeron.analysis.subject.Subject(mission, airframe, selection, overrides=<factory>)[source]¶
Bases:
objectOne mission architecture: the referent of every tour pane.
selectionmaps each variation point except the airframe point to a variant name.overridesmaps an attribute path to a transient value. A transient value replaces the model value for the analysis only and never writes the model.
- longeron.analysis.subject.craft_variant(study, element, *, point='airframe')[source]¶
The variant of
pointthatelementnames, orNone.elementis a variant usage of the point’s variation definition, or the definition that types a variant. The match is exact: a specialization of a variant’s type does not match that variant. A build configuration such asRotorcraft::QuadCoptertypes no variant, so the function returnsNonefor it.
- longeron.analysis.subject.preset(study, airframe, metric, *, point='airframe')[source]¶
The best mix for
airframebymetric, larger values first.The function pins
pointtoairframeand evaluates every mix of the other variation points with the interpreter. The result is the verified mix with the largestmetric. If no mix is verified, the result is the mix with the fewest violations, and the largermetricbreaks a tie. Thebasisfield tells the two cases apart. EveryDEFAULT_MISSIONSmetric is larger-is-better.- Return type:
- longeron.analysis.subject.requirement_set(mission, airframe, *, interp)[source]¶
Each applicable requirement, with the instance it scores.
A requirement here is a requirement definition, or a requirement usage that a package owns (such as
DeepScout::installation). A nested requirement usage scores with its owner.missionis an instance of the mission definition, andairframeis the airframe instance thatmissionholds. Ifmissionorairframeconforms to the type of the subject parameter, the requirement definition is a candidate. The interpreter checks a candidate againstmissionfirst, then againstairframe. The first instance that satisfies every assume constraint is the pair. An assume constraint that the interpreter cannot evaluate does not hold. A requirement that applies to neither instance is not in the result. The keys are qualified names, in model order.