API Reference

rst_controllers.rstPlotTool.cli

Command-line interface for rst_controllers.rstPlotTool.

The CLI supports two usage styles:

  1. Modern subcommand form:

    python -m rst_controllers.rstPlotTool.cli run out/*.csv --overlay
    
  2. Historical no-subcommand form:

    python -m rst_controllers.rstPlotTool.cli out/*.csv --overlay
    

It also includes a sphinx-skel helper for generating a conservative, GitHub Pages friendly Sphinx documentation skeleton.

rst_controllers.rstPlotTool.cli.args_to_request(ns)[source]

Convert parsed CLI arguments into a plotting RunRequest.

Parameters:

ns (Namespace)

Return type:

RunRequest

rst_controllers.rstPlotTool.cli.build_parser()[source]

Build the command-line parser.

Return type:

ArgumentParser

rst_controllers.rstPlotTool.cli.main(argv=None)[source]

Run the rstPlotTool command-line interface.

Parameters:

argv (list[str] | None)

Return type:

int

rst_controllers.rstPlotTool.apis

class rst_controllers.rstPlotTool.apis.OverlayFilters(include: 'Optional[str]' = None, exclude: 'Optional[str]' = None)[source]

Bases: object

Parameters:
  • include (str | None)

  • exclude (str | None)

exclude: str | None = None
include: str | None = None
class rst_controllers.rstPlotTool.apis.RunRequest(files: 'List[str]', overlay: 'Optional[bool]' = None, backend: 'str' = 'both', style: 'str' = 'matlab', dpi: 'int' = 150, kmin: 'Optional[float]' = None, kmax: 'Optional[float]' = None, robust: 'float' = 0.995, ylimits: 'YLimits' = <factory>, clip: 'bool' = False, legend: 'str' = 'compact', filters: 'OverlayFilters' = <factory>, annotate: 'Optional[str]' = None, title: 'Optional[str]' = None)[source]

Bases: object

Parameters:
  • files (List[str])

  • overlay (bool | None)

  • backend (str)

  • style (str)

  • dpi (int)

  • kmin (float | None)

  • kmax (float | None)

  • robust (float)

  • ylimits (YLimits)

  • clip (bool)

  • legend (str)

  • filters (OverlayFilters)

  • annotate (str | None)

  • title (str | None)

annotate: str | None = None
backend: str = 'both'
clip: bool = False
dpi: int = 150
files: List[str]
filters: OverlayFilters
kmax: float | None = None
kmin: float | None = None
legend: str = 'compact'
overlay: bool | None = None
robust: float = 0.995
style: str = 'matlab'
title: str | None = None
ylimits: YLimits
class rst_controllers.rstPlotTool.apis.YLimits(ylimY: 'Optional[Tuple[float, float]]' = None, ylimU: 'Optional[Tuple[float, float]]' = None, ylimE: 'Optional[Tuple[float, float]]' = None)[source]

Bases: object

Parameters:
  • ylimY (Tuple[float, float] | None)

  • ylimU (Tuple[float, float] | None)

  • ylimE (Tuple[float, float] | None)

ylimE: Tuple[float, float] | None = None
ylimU: Tuple[float, float] | None = None
ylimY: Tuple[float, float] | None = None

rst_controllers.rstPlotTool.app

class rst_controllers.rstPlotTool.app.RSTPlotApp[source]

Bases: object

High-level orchestrator for plotting RST step-response CSVs.

run(req)[source]
Parameters:

req (RunRequest)

Return type:

None

rst_controllers.rstPlotTool.core

rst_controllers.rstPlotTool.core.crop_by_k(d, kmin, kmax)[source]
Parameters:
  • d (Dict[str, numpy.ndarray])

  • kmin (float | None)

  • kmax (float | None)

Return type:

Dict[str, numpy.ndarray]

rst_controllers.rstPlotTool.core.robust_limits(vals, robust)[source]
Parameters:
  • vals (numpy.ndarray)

  • robust (float)

Return type:

Tuple[float, float]

rst_controllers.rstPlotTool.core.step_metrics(k, r, y)[source]
Parameters:
  • k (numpy.ndarray)

  • r (numpy.ndarray)

  • y (numpy.ndarray)

Return type:

Dict[str, float]

rst_controllers.rstPlotTool.io

rst_controllers.rstPlotTool.io.expand_files(patterns)[source]
Parameters:

patterns (Sequence[str])

Return type:

List[str]

rst_controllers.rstPlotTool.io.load_csv(path)[source]
Parameters:

path (str)

Return type:

Dict[str, numpy.ndarray]

rst_controllers.rstPlotTool.io.load_design_json(path)[source]
Parameters:

path (str | None)

Return type:

dict | None

rst_controllers.rstPlotTool.utils

rst_controllers.rstPlotTool.utils.ensure_pkg_out_dir(path)[source]
Parameters:

path (str | None)

Return type:

str

rst_controllers.rstPlotTool.utils.in_pkg_path(*parts)[source]
Parameters:

parts (str)

Return type:

str

rst_controllers.rstPlotTool.utils.out_pkg_path(*parts)[source]
Parameters:

parts (str)

Return type:

str

rst_controllers.rstPlotTool.utils.with_out_dir(func)[source]

rst_controllers.rstPlotTool.design

rst_controllers.rstPlotTool.design.apply_mpl_style(style, dpi)[source]
Parameters:
  • style (str)

  • dpi (int)

Return type:

None

rst_controllers.rstPlotTool.design.make_plotly_figure(template)[source]
Parameters:

template (str)

rst_controllers.rstPlotTool.design.mpl_overlay(figpath, files, datasets, style, dpi, legend_mode='compact', robust=0.995, ylims=(None, None, None), clip_to_limits=False, title='RST Step Overlay')[source]
Parameters:
  • figpath (str)

  • files (List[str])

  • datasets (List[Dict[str, numpy.ndarray]])

  • style (str)

  • dpi (int)

  • legend_mode (str)

  • robust (float)

  • ylims (Tuple[Tuple[float, float] | None, Tuple[float, float] | None, Tuple[float, float] | None])

  • clip_to_limits (bool)

  • title (str)

Return type:

None

rst_controllers.rstPlotTool.design.mpl_single(figpath, data, title, style, dpi, ylims=(None, None, None), annotate=None)[source]
Parameters:
  • figpath (str)

  • data (Dict[str, numpy.ndarray])

  • title (str)

  • style (str)

  • dpi (int)

  • ylims (Tuple[Tuple[float, float] | None, Tuple[float, float] | None, Tuple[float, float] | None])

  • annotate (dict | None)

Return type:

None

rst_controllers.rstPlotTool.design.plotly_overlay(htmlpath, files, datasets, style, legend_mode='compact', robust=0.995, ylims=(None, None, None), title='RST Step Overlay')[source]
Parameters:
  • htmlpath (str)

  • files (List[str])

  • datasets (List[Dict[str, numpy.ndarray]])

  • style (str)

  • legend_mode (str)

  • robust (float)

  • ylims (Tuple[Tuple[float, float] | None, Tuple[float, float] | None, Tuple[float, float] | None])

  • title (str)

Return type:

None

rst_controllers.rstPlotTool.design.plotly_single(htmlpath, data, title, style, ylims=(None, None, None), annotate=None)[source]
Parameters:
  • htmlpath (str)

  • data (Dict[str, numpy.ndarray])

  • title (str)

  • style (str)

  • ylims (Tuple[Tuple[float, float] | None, Tuple[float, float] | None, Tuple[float, float] | None])

  • annotate (dict | None)

Return type:

None

rst_controllers.rstPlotTool.design.plotly_template_for(style)[source]
Parameters:

style (str)

Return type:

str