Grand tour dashboard

Requires the viz extra for the widgets and the mdao/smt extras for the sizing and verdict strips (pip install "longeron[viz,mdao,smt]").

grand_dashboard shows one subject: one mission architecture (Subject). A mission architecture is a mission definition, one airframe variant, and one variant for each other variation point. Every pane follows the subject. The grand tour tutorial builds the dashboard and proves each reaction headless.

import longeron
from longeron.analysis.grand import grand_dashboard

program = longeron.load("examples/deepscout")
dash = grand_dashboard(program)  # the ISR winner
dash = grand_dashboard(program, mission="logistics", airframe="flyingWingTwinTip")

Layout and exposed pieces

The layout fits one 1080p screen. A tab group is a set of panes that share one place, and its tab bar shows one pane at a time. Below the header, one row holds three columns:

  • The tree column at the left is as tall as the row. Its button (.tree_toggle) collapses the column to a thin strip, and the structure diagram takes the width. A click on the strip expands the column again.

  • The centre column holds the structure diagram over the Analysis tabs (.analysis), a tab group.

  • The Views tabs (.views) at the right are a tab group.

Each pane of one tab group shows beside each pane of the other. For example, the Subject & knobs tab shows the sliders beside the 3D pane or the scoreboard that they repaint.

The returned VBox exposes each pane as an attribute, for scripts and tests:

Place

Pane

Attributes

top

header

.header

tree column

containment tree

.tree (a ModelTree), .tree_toggle

centre column

structure diagram

.diagram

Views tabs: 3D

3D pane

.viewer, .config_view, .unlink, .mesh, .part_map, .camera

Views tabs: Requirements

requirements scoreboard

.board, .scoreboard, .requirements

Views tabs: Mission

Cesium pane

.mission, .track

Analysis tabs: Subject & knobs

subject card

.mission_toggle, .subject_card, .knobs, .knob_set

Analysis tabs: Camera what-if

camera what-if

.elevation, .azimuth, .readout, .report

Analysis tabs: Sizing

OpenMDAO sizing strip

.sizing_title, .loiter, .optimize, .problem, .optimum, .sizing_card

Analysis tabs: Sizing

driver history

.sizing_history

Analysis tabs: Sizing

design variable and constraint table

.sizing_table

Analysis tabs: Sizing

N2 matrix

.sizing_n2

Analysis tabs: Z3

Z3 verdict strip

.verdict_title, .smt_sat, .smt_what_if, .verdicts

JupyterLab main area

docked panes

.dock, .undock, .panels

The subject state is .subject, .architecture (the trade-study result with the overrides applied), .craft (the qualified name of the airframe definition) and .studies (one trade study per visited mission). .sizing_contexts holds the mission-to-context map, and .values the injected scoreboard values. The sizing and Z3 attributes are None for a mission without a sizing context.

Dock the panes in JupyterLab

dash.dock() moves the panes into the JupyterLab main area, the part of the window that shows the notebook and the other open documents. Each pane group becomes a docked pane: an ipylab.Panel with a titled tab. A split bar is the thin bar between two docked panes. A drag of a split bar resizes the two panes, and a drag of a tab moves a pane.

Tab

Widgets

Tab key (data-lgxkey)

Tree

.tree

grand-tree

Structure

.diagram

grand-structure

3D

.viewer

grand-3d

Scoreboard

.board

grand-scoreboard

Subject

.header and the subject card

grand-subject

Camera what-if

the camera what-if card

grand-camera

Sizing

the OpenMDAO sizing strip

grand-sizing

Z3

the Z3 verdict strip

grand-z3

Mission

.mission

grand-mission

The first view shows each pane in its own panel. The first four tabs make the top row, and the four cards make the next row. The inline tab groups do not dock. dash.undock() puts each pane back into its tab group. The Mission tab is the current tab of the notebook’s tab area, at the bottom. .panels maps each pane name to its panel while the tour is docked, and it is empty while the tour is inline.

The docked panes hold the same widget instances as the inline layout, so the selection links keep working. A closed tab does not close its widgets. A second dash.dock() closes the open panels and docks all nine panes again in the first view. dash.undock() closes the panels and shows the inline layout again. grand_dashboard(..., dock=True) docks the dashboard when it is built. If no JupyterLab front end hosts the kernel, dock() prints a note and the layout stays inline.

Driver renderings

The three driver renderings explain the OpenMDAO problem of the sizing context. A driver iteration is one model evaluation that the optimization driver records:

  • .sizing_history plots the objective and each constraint margin for each driver iteration of the last maximize run. A margin is zero at the bound of its constraint. Before the first run, it says “run maximize to see the driver’s path”.

  • .sizing_table lists the design variables and the constraints with their lower bound, current value and upper bound. A constraint value is its margin. The loiter slider updates the values. A maximize run sets the active flags. An active constraint is at a bound at the optimum.

  • .sizing_n2 is an N2 matrix of the problem: the components on the diagonal, and a mark where an output of the row component feeds an input of the column component. The hover title of a mark names the connected variables.

run_optimization() returns the OptimizationHistory of a run, and problem_structure() returns the ProblemStructure behind the matrix.

API

The grand-tour dashboard: every analysis seam on one linked surface.

One grand_dashboard() call composes the house widgets over a drone model (plus the multi-mission sizing model) into a single reactive dashboard – the capability finale of the tutorial series (tutorial 9).

Every pane follows one subject (longeron.analysis.subject.Subject): one mission architecture. A subject is a mission (a key of longeron.analysis.dashboard.DEFAULT_MISSIONS), one variant of the mission’s airframe variation point, one variant for each other variation point, and transient overrides. A transient override replaces a model value for the analysis only and never writes the model. A visiting craft is a craft that the 3D pane shows but that is not the subject.

The layout fits one 1080p screen. A header line names the subject. A tab group is a set of panes that share one place. Its tab bar shows one pane at a time. Below the header, one row holds three columns:

  • the tree column at the left, as tall as the row. Its button collapses the column to a thin strip, and the structure diagram takes the width. A click on the strip expands the column again;

  • the centre column: the structure diagram over the Analysis tabs, a tab group;

  • the Views tabs at the right, a tab group.

The Views tabs hold the 3D pane, the requirements scoreboard and the Cesium pane. The Analysis tabs hold the subject card, the camera what-if, the sizing strip and the Z3 strip. Thus each pane of one tab group shows beside each pane of the other. The panes, in layout order:

  • a header that names the subject’s mission, airframe and selection, shows the requirements score, and says when the 3D pane shows a visiting craft;

  • the tree column: a containment tree pane (longeron.widgets.explorer.ModelTree, the model explorer’s tree). The containment tree lists every package, definition, usage and relationship by ownership;

  • the centre column: a structure diagram pane (longeron.diagrams.structure_diagram(), compact toolbar on) – the linked-selection hub;

  • the Views tabs (3D): a 3D CAD pane (longeron.widgets.viewer3d.mesh_viewer()), config-keyed through longeron.analysis.link.bind_config_view() (tutorial 7’s seam, promoted). It shows the subject craft, baked from the subject’s mix (longeron.analysis.geometry.mission_geometry()) with the craft’s declared camera. A click on any other craft – a build configuration, a fleet airframe shell, or a variant usage of the mission catalog – renders THAT craft. A catalog craft becomes the subject’s airframe (see the wiring map), and any other craft is a visiting craft. Selections inside the shown craft highlight per M0 individual. A translucent view cone follows the camera what-if sliders over the subject craft;

  • the Views tabs (Requirements): a requirements scoreboard pane (longeron.analysis.scoreboard.scoreboard(), Voronoi tessellation) scoring the subject’s requirement set (longeron.analysis.subject.requirement_set()). Each requirement scores for the subject instance where it applies: the mission architecture, or its airframe. The board repaints live as the subject and the measured geometry change;

  • the Analysis tabs (Subject & knobs): a subject card – a mission selector, the subject’s mission metric and verdict, and the knobs (longeron.analysis.knobs.derive_knobs()): a dropdown per variation point other than the airframe, and a slider per input attribute that the model bounds on both sides;

  • the Analysis tabs (Camera what-if): a camera what-if card – elevation/azimuth sliders that re-run the CAD-native occlusion measure (longeron.analysis.geometry.occlusion_report(), deterministic mesh engine) on the subject craft’s declared camera on every move. The assume constraints of the camera_case analysis case bound the sliders. A craft that declares no camera shows an honest absence;

  • the Analysis tabs (Sizing): an OpenMDAO sizing strip – the generated Problem (longeron.analysis.mdao.build_problem()) of the mission’s sizing context, a frozen sizing part such as ScoutSizing::IsrPrime. A loiter-speed slider re-runs it live, and a one-click driver run snaps the slider to the optimum. The model supplies the slider bounds and the optimizer bounds. Below the slider, the strip shows the history of the last driver run (the objective and each constraint margin per driver iteration), a table of the design variables and constraints with their bounds and active flags, and an N2 matrix of the problem’s components and connections (problem_structure()). The strip title names the sizing context;

  • the Analysis tabs (Z3): a Z3 verdict strip – requirement-consistency cards (longeron.analysis.smt.to_smt()) for the same sizing context: the design point’s SAT witness beside an impossible what-if’s UNSAT conflict core. A mission without a sizing context shows an honest absence in both strips;

  • the Views tabs (Mission): a Cesium mission pane (longeron.widgets.mission3d) flying the subject’s geometry through the recorded execution of the shared FlightStates machine over the shared route, at satellite imagery (offline front-ends degrade to a printed note; the dashboard composes regardless). Its view-mode buttons track the drone (the default), stop the tracking, or look through the subject craft’s declared camera ('onboard'). The onboard view uses the camera what-if angles. The subject’s shell sets the flight profile (longeron.analysis.mission3d.model_flight()): a multirotor climbs vertically, a rail-launched wing climbs out along the first leg and banks through the corners.

WIRING MAP – everything reacts to everything, kernel-side, through traitlets observers (so the whole surface works headless):

  • mission selector -> the subject keeps its airframe, and the airframe’s preset for the new mission (longeron.analysis.subject.preset()) fills the other variation points. The overrides of the old mission are dropped;

  • diagram or tree click on a catalog craft (a variant of the airframe variation point, or the definition that types one) -> the craft becomes the subject’s airframe and its preset fills the other variation points, and the mission-level overrides stay;

  • dropdown knob -> that variation point changes, and the others stay;

  • slider knob -> a transient override that reaches longeron.analysis.trades.TradeStudy.evaluate();

  • any subject change -> the subject scene re-bakes (the stale entry of longeron.analysis.link.ConfigViewBinding.scenes is replaced), the 3D pane shows the subject, the camera card measures the subject’s declared camera (a new airframe resets the sliders to its declared angles), the scoreboard re-scores the subject’s requirement set, the Cesium pane flies the subject’s mesh, and the header names the new subject. The 3D pane re-fits its camera only if it showed another craft before. A knob change of the shown craft keeps the camera, so a wider wing draws wider;

  • mission change -> the sizing and Z3 strips show the new mission’s sizing context, built on its first use, or an honest absence;

  • diagram click -> 3D highlight (and mesh pick -> diagram selection);

  • containment tree selection -> diagram selection of the element, or of its nearest drawn ancestor when the diagram does not draw the element (the diagram selection then drives the 3D pane and the scoreboard); diagram selection -> containment tree selection, with the row revealed;

  • diagram click on a build configuration (Rotorcraft::QuadCopter and its siblings, which are not catalog airframes) -> the 3D pane shows it as a visiting craft, the subject does not change, and the camera what-if keeps measuring the subject craft;

  • diagram click on a requirement -> scoreboard selection (and a scoreboard cell click -> diagram selection);

  • camera sliders -> occlusion re-measure -> the view cone repaints, the obstructing parts highlight in 3D, the occlusion readout lists them, the scoreboard recolors, and the header score updates. The 3D pane keeps its camera. The Cesium pane’s onboard_camera takes the new angles, so the onboard view looks where the occlusion measure looks;

  • loiter slider -> run_model -> the sizing cards and the table values repaint; the maximize button runs the optimization driver (run_optimization()), fills the history plot and the active flags, and snaps the slider.

Requires the viz extra for the widgets and the mdao/smt extras for the sizing and verdict strips: pip install "longeron[viz,mdao,smt]".

longeron.analysis.grand.ATLANTA_LOOP: tuple[tuple[float, float, float], ...] = ((33.7813, -84.3833, 50.0), (33.7885, -84.3785, 90.0), (33.79, -84.3695, 80.0), (33.7838, -84.369, 60.0), (33.777, -84.3825, 50.0))

default mission route: a small loop over Piedmont Park, midtown Atlanta – (lat, lon, alt) with alt in meters above ground level (AGL), the datum the Cesium globe draws (see longeron.analysis.mission3d). The route flies 50-90 m above the ground.

longeron.analysis.grand.DEFAULT_SIZING_CONTEXTS: dict[Literal['ISR', 'logistics', 'intercept'], tuple[str, str, str]] = {'ISR': ('ScoutSizing::IsrPrime', 'ScoutSizing::IsrStation', 'stationMinutes')}

default sizing contexts of grand_dashboard(): mission name -> (sizing part, station requirement, station attribute). Only the ISR mission has a frozen sizing context in the DeepScout program today, so the logistics and intercept strips show an honest absence.

longeron.analysis.grand.FLIGHT_EVENTS: tuple[Any, ...] = (2.0, 'launch', 6.0, 'airborne', 150.0, 'low_battery', 10.0)

default event feed for the flight state machine replay (the Interpreter.simulate protocol: numbers advance the clock)

longeron.analysis.grand.DockPane

the panes that GrandDock.dock() moves into the JupyterLab main area. Each pane’s tab carries data-lgxkey="grand-<pane>"

alias of Literal[‘mission’, ‘structure’, ‘subject’, ‘3d’, ‘scoreboard’, ‘tree’, ‘sizing’, ‘camera’, ‘z3’]

class longeron.analysis.grand.GrandDock(box, panes, *, style)[source]

Bases: object

The dock state of one grand tour: dock() and undock().

A docked pane is a group of dashboard widgets in its own JupyterLab main-area panel (an ipylab.Panel) with a titled tab. The Lab dock puts a split bar on each edge that two docked panes share, and a drag of the split bar resizes the two panes. A drag of a tab moves its pane to another place in the dock. The panels hold the SAME widget instances as the inline layout, so the kernel-side selection hub keeps working wherever the widgets show. panes maps each DockPane to its widgets, each with the layout keywords it takes while docked (None keeps its layout).

panels: dict[Literal['mission', 'structure', 'subject', '3d', 'scoreboard', 'tree', 'sizing', 'camera', 'z3'], Any]

pane -> its ipylab.Panel while docked, empty while inline

dock()[source]

Move the panes into the JupyterLab main area, nine panels.

The first view shows each pane in its own panel: the tree, the structure diagram, the 3D pane and the scoreboard in the top row, and the subject, camera what-if, sizing and Z3 cards in the next row. The Cesium pane is the current tab of the notebook’s tab area, below the cards, and the notebook tab stays beside it. The inline tab groups do not dock: the panes leave them, and undock() puts each pane back into its tab group. The inline layout shows a note in place of the panes.

A second dock() closes the open panels and docks all nine panes again in the first view. Thus dock() also re-opens a pane whose tab the user closed. A closed tab does not change the widgets, so the selection hub keeps working. The tabs carry the explorer’s dock identity (_DockSweeper), so a dock after a kernel restart closes the panels of the dead kernel. If no JupyterLab front end hosts the kernel, dock() prints a note and keeps the inline layout.

Return type:

None

undock()[source]

Close the panels and show the inline layout again.

The widgets take back their inline layouts. If the tour is not docked, undock() does nothing.

Return type:

None

longeron.analysis.grand.drone_scene(model, assembly='Rotorcraft::QuadCopter')[source]

Bake the tagged per-instance mesh for a drone-family assembly.

Interprets assembly at M0 (longeron.m0.interpret()), sizes the parametric mesh from the population’s own attribute values (longeron.analysis.geometry.drone_geometry(), split_instances=True), and stamps every rendered part with its M0 individual id (tutorial 7’s identity keys). The rotor population picks the frame family – the CONFIG-KEYED rendering seam: a motors population fans out one arm per member (the quad and the hexa), frontMotors + tailMotor build the three-arm tricopter with its tail boom, and upperMotors + lowerMotors stack the coaxial pairs (uppers take motor1..4 / the first propeller individuals, lowers follow). The assembly must have the MultiRotor build-family shape of the DeepScout program (examples/deepscout): chassis, battery, and propellers slots, one of the rotor-population shapes above, plus an optional camera whose placement/boresight attributes drive the occlusion checks. Pair with longeron.analysis.link.owning_config() to resolve a diagram selection anywhere inside a configuration to the configuration this function renders. Returns (mesh, part_map).

Return type:

tuple[dict[str, Any], dict[str, str]]

longeron.analysis.grand.grand_dashboard(model, sizing=None, *, mission='ISR', airframe=None, states='DeepScout::FlightStates', sizing_contexts={'ISR': ('ScoutSizing::IsrPrime', 'ScoutSizing::IsrStation', 'stationMinutes')}, loiter_var='loiterSpeed', what_if_station=420.0, camera_case='ScoutSurfaces::CameraWhatIf', values=None, waypoints=((33.7813, -84.3833, 50.0), (33.7885, -84.3785, 90.0), (33.79, -84.3695, 80.0), (33.7838, -84.369, 60.0), (33.777, -84.3825, 50.0)), events=(2.0, 'launch', 6.0, 'airborne', 150.0, 'low_battery', 10.0), ground_alt=0.0, imagery='satellite', dock=False)[source]

The grand-tour dashboard (an ipywidgets VBox) – one call.

model carries the drone program: its structure feeds the diagram and the containment tree, its mission definitions (DEFAULT_MISSIONS) and their trade studies supply the subject (a Subject: one mission, one airframe variant, one variant per other variation point, and transient overrides), its requirement hierarchy is the scoreboard, and its states machine flies the Cesium mission over waypoints. The waypoint heights and ground_alt are heights above ground. The default ground_alt 0 starts and ends the flight on the surface. mission names the first subject’s mission, and airframe its airframe variant. The default airframe is the mission’s winner: the airframe whose preset (preset()) has the best mission metric.

The scoreboard scores the subject’s requirement set (requirement_set()), each requirement for the subject instance where it applies. values injects extra measured scoreboard bindings, for example performance measures that the interpreter computes. The live occlusion and disc-overlap measures of the subject craft merge on top.

sizing (default: model itself) carries the continuous side. sizing_contexts maps a mission to its sizing context: the sizing part, the station requirement, and the station attribute. For the subject’s mission, the sizing part becomes the OpenMDAO problem behind the loiter_var slider, and the requirement becomes the Z3 consistency cards. The what-if card demands station attribute >= what_if_station with loiter_var freed. That floor is impossible, and its UNSAT core names the binding constraints. The model supplies the slider bounds and the optimizer bounds (derive_knobs() on the sizing part). Each context builds once, when its mission first becomes the subject’s mission. A mission without a sizing context shows an honest absence in both strips. camera_case names the analysis case whose assume constraints bound the camera sliders (attribute_domains()).

See the module docstring for the pane list and the wiring map. The returned layout exposes every piece for scripting and tests: .subject (the current Subject), .architecture (its TradeStudy.evaluate result, overrides applied), .craft (the qualified name of the subject’s airframe definition), .studies (mission name -> trade study, built on first use), .mission_toggle (the mission selector), .knobs (knob name -> widget: a variation point name gives its dropdown, a slider name such as minStationMinutes its slider), .knob_set (the KnobSet behind them), .diagram, .tree (the containment tree, a ModelTree), .tree_toggle (the tree column’s collapse button: True collapses the column), .views and .analysis (the two ipywidgets.Tab tab groups), .viewer, .board (+ .scoreboard, the current Scoreboard), .elevation / .azimuth / .readout / .report, .loiter / .optimize / .problem / .optimum / .sizing_card / .sizing_history / .sizing_table / .sizing_n2 and .smt_sat / .smt_what_if / .verdicts (the current mission’s sizing context, each None when the mission has none), .sizing_title / .verdict_title (the strip titles), .requirements (requirement qualified name -> the subject instance it scores), .mission (the Cesium viewer: set .mission.view_mode to 'onboard' to look through .mission.onboard_camera, the subject’s camera at the slider angles) / .track, .mesh / .part_map / .camera (the subject scene, its identity keys, and its declared camera, None when the craft declares none), .header, .config_view (the ConfigViewBinding behind the config-keyed 3D pane), .unlink (drops the diagram <-> 3D binding), .dock / .undock (GrandDock.dock() and GrandDock.undock(): move the panes into the JupyterLab main area as nine resizable, rearrangeable panels, and back), and .panels (DockPane -> its ipylab.Panel while docked, empty while inline). dock=True docks the dashboard when it is built. The inline layout is the default, so a notebook without a JupyterLab front end renders as before.

Return type:

Any

longeron.analysis.grand.scene_for(model, config, *, interpreter=None, tilt_deg=None)[source]

Bake the tagged scene for ANY renderable craft definition.

One dispatcher over both DeepScout craft families. A fleet airframe shell – a definition whose own attributes evaluate to the Airframe geometry knobs (wingSpan, wingArea, taper, fuselageLength, motorCount, armCount) – renders through longeron.analysis.geometry.airframe_geometry() at nominal display propulsion. Every part carries the definition’s qualified name as its identity key (selecting the def lights the whole craft), EXCEPT the clickable internals: a rendered battery, fc, or camera part whose shell declares the matching part usage (battery / flightController / camera – every DeepScout fleet shell does) carries THAT usage’s qualified name, so picking the battery in the scene selects the battery element, not just the craft. A shell that declares a camera part also carries that camera’s parameters on mesh["camera"], so longeron.analysis.geometry. occlusion_report() measures every craft family. Anything else goes to drone_scene(): the MultiRotor build family bakes from its own M0 population with per-individual identity keys, and non-assembly shapes fail loudly with AnalysisError.

This is the config-keyed rendering seam behind longeron.analysis.link.bind_config_view(): resolve a selection to its owning configuration, hand the configuration here, swap the viewer to the result. tilt_deg is the tilt-rotor family’s conversion state (hover 90 .. cruise 0, the scene-level knob behind tilt_viewer()); shells that declare no pivot chain ignore it. Returns (mesh, part_map).

Return type:

tuple[dict[str, Any], dict[str, str]]

longeron.analysis.grand.tilt_viewer(model, config='TiltRotors::TiltTriWing', *, tilt_deg=90.0, width_px=640, height_px=420)[source]

A mesh viewer with the tilt-rotor conversion affordance.

One longeron.widgets.viewer3d.mesh_viewer() over one ipywidgets slider: the slider commands the conversion state, sweeping hover (90 deg) to cruise (0), and every move re-bakes the scene through scene_for() at that tilt – the tip pods and the nose unit rotate about the pivots the MODEL declares, so the slider drives the same geometry the interference gate samples. The returned VBox exposes the pieces for scripting and tests: .viewer (the mesh viewer), .tilt (the slider), and .part_map. Requires the viz extra.

Return type:

Any

longeron.analysis.grand.view_cone_part(camera, *, length, name='viewCone', segments=48, color='#7a5d8c', opacity=0.25)[source]

A translucent view-cone mesh part for the 3D scene.

Apex at the camera position, axis along the azimuth/elevation boresight, half-angle fieldOfView / 2, reaching length metres – the same construction longeron.analysis.geometry. occlusion_report() measures, here as a display part (append it to a scene’s parts; never to the analysis mesh, where it would count as an obstruction). camera uses the attribute names of the DeepScout program’s ScoutParts::F450Kit::Camera part. Untagged, so linked selection ignores it.

Return type:

dict[str, Any]