pySimBlocks.project.plot_series

class pySimBlocks.project.plot_series.SeriesStyle(color: str = '', linestyle: str = '-', marker: str = '', display_name: str = '')[source]

Bases: object

Matplotlib draw style for one logged series component.

color: str = ''
linestyle: str = '-'
marker: str = ''
display_name: str = ''
pySimBlocks.project.plot_series.normalize_marker_code(marker: object) str[source]

Return a stripped marker code string, or empty for no marker.

pySimBlocks.project.plot_series.is_usable_line_marker(marker: object) bool[source]

True if matplotlib can draw this marker on a Line2D (step/plot).

pySimBlocks.project.plot_series.normalize_plot_marker(marker: object) str[source]

Return marker code for plotting, or ‘’ if missing or not supported on lines.

pySimBlocks.project.plot_series.series_style_to_dict(style: SeriesStyle) dict[str, str][source]

Serialize a series style, omitting default fields.

pySimBlocks.project.plot_series.series_style_from_dict(data: dict[str, Any] | None) SeriesStyle[source]

Build a SeriesStyle from a YAML/plot-config mapping.

pySimBlocks.project.plot_series.merge_series_styles(primary: SeriesStyle, fallback: SeriesStyle) SeriesStyle[source]

Merge two styles; non-empty fields in primary override fallback.

pySimBlocks.project.plot_series.resolve_series_style(label: str, session_styles: dict[str, SeriesStyle], plot: dict | None = None) SeriesStyle[source]

Merge plot-config styles with in-session overrides (session wins).

pySimBlocks.project.plot_series.effective_style_for_component(plot: dict | None, panel: dict | None, label: str) SeriesStyle[source]

Style for one component label: panel series_styles overrides plot-level.

pySimBlocks.project.plot_series.filter_series_by_signal(series_by_signal: list[tuple[str, list[tuple[str, ndarray]]]], components: list[str] | None) list[tuple[str, list[tuple[str, ndarray]]]][source]

Keep only component labels listed in components (if provided).

pySimBlocks.project.plot_series.flatten_series(series_by_signal: list[tuple[str, list[tuple[str, ndarray]]]]) list[tuple[str, str, ndarray]][source]

Flatten grouped series into (signal, label, values) tuples.

pySimBlocks.project.plot_series.stack_logged_signal(logs: dict, sig: str) ndarray[source]

Stack a logged signal over time into a (T, m, n) array.

pySimBlocks.project.plot_series.series_from_signal(logs: dict, sig: str) list[tuple[str, ndarray]][source]

Return flat (label, values) series for one signal.

pySimBlocks.project.plot_series.plot_step_series_styled(ax, time: ndarray, values: ndarray, label: str, style: SeriesStyle | None = None) None[source]

Draw one step series with optional style (shared by GUI and plot_from_config).

pySimBlocks.project.plot_series.is_manual_layout_plot(plot: dict) bool[source]

Return True if plot is a saved multi-panel manual layout preset.

pySimBlocks.project.plot_series.panel_dict_from_selection(title: str, selection: dict[str, set[str]], series_styles: dict[str, SeriesStyle] | None = None) dict[str, Any][source]

Serialize one manual panel for YAML storage.

pySimBlocks.project.plot_series.selection_from_panel_dict(panel: dict) dict[str, set[str]][source]

Restore one manual panel selection from YAML.

pySimBlocks.project.plot_series.manual_layout_to_plot_dict(preset_title: str, panel_titles: list[str], panel_selections: list[dict[str, set[str]]], panel_styles: list[dict[str, SeriesStyle]]) dict[str, Any] | None[source]

Build one plot preset that stores a full manual multi-panel layout.

Each entry in panel_styles holds styles for component labels in that panel only (name, color, etc. may differ per panel for the same signal).

pySimBlocks.project.plot_series.manual_state_from_layout_plot(plot: dict) tuple[list[dict[str, set[str]]], list[str], list[dict[str, SeriesStyle]]][source]

Extract manual panel state from a layout preset.

Returns one style map per panel (merged plot-level + panel-level YAML).