phenotypic.gui.results_viewer package#
Interactive results viewer for PhenoTypic CLI output.
Public entry points:
create_app()– build a configureddash.Dashinstance for anOutputRoot(seephenotypic.gui.results_viewer._output_root). Useful when an embedding application wants to mount the viewer alongside other Dash pages.launch_results_viewer()– one-shot launcher that discovers the output root, builds the app, prints a startup banner, and runs the server. Mirrors whatpython -m phenotypic.gui.results_viewerdoes.
- phenotypic.gui.results_viewer.create_app(output_root: OutputRoot | None = None, *, url_prefix: str = '/', api_url_prefix: str = '/') Dash[source]#
Build a Dash application instance for the results viewer.
- Parameters:
output_root (OutputRoot | None) – Validated, read-only handle on a CLI output directory (see
phenotypic.gui.results_viewer._output_root.OutputRoot.discover()).Nonetriggers the empty-state pathway: the factory skips blueprint registration,FilteredMeasurements.load, and callback registration;app.layoutis the empty-state placeholder.url_prefix (str) – Mount-point prefix. Defaults to
"/"(standalone launcher); the hub composer passes"/results/". Set asrequests_pathname_prefix/routes_pathname_prefixon the Dash constructor and stashed onapp.server.config["pheno_url_prefix"].api_url_prefix (str) – Browser-visible base prefix for shell-level Flask APIs. Defaults to
"/"; the hub passes the external proxy prefix when configured.
- Returns:
A configured
dash.Dashinstance whoseapp.run(...)is the responsibility of the caller.- Return type:
Dash
- phenotypic.gui.results_viewer.launch_results_viewer(output_root: Path | str = PosixPath('/home/runner/work/PhenoTypic/PhenoTypic/docs'), host: str = '127.0.0.1', port: int = 8050, debug: bool = False, url_prefix: str = '/') None[source]#
Boot the Dash results viewer against an output root.
Validates the directory layout via
OutputRoot.discover(), builds the Dash app viaphenotypic.gui.results_viewer._app.create_app(), prints a one-shot startup banner with SSH-tunnel and cache-nuke hints, and finally hands control toapp.run(which blocks until the user interrupts).- Parameters:
output_root (Path | str) – Path to a CLI output directory (the one containing
master_measurements.parquetandresults/). Strings are accepted for ergonomics; both are resolved to an absolutepathlib.Path. Defaults to the current working directory.host (str) – Interface to bind.
DEFAULT_HOSTkeeps the server loopback-only – pair with SSH port forwarding for remote access.0.0.0.0exposes the app on the network.port (int) – TCP port to bind. Defaults to
DEFAULT_PORT.debug (bool) – Run Dash in debug mode (auto-reload + verbose tracebacks). Defaults to
False.url_prefix (str) – Browser-visible path prefix for path-stripping reverse proxies such as Open OnDemand. Defaults to
"/".
- Raises:
FileNotFoundError – If output_root does not contain a valid CLI output layout.
ValueError – If the master measurements parquet is missing required
Metadata_Dataset/Metadata_ImageFilecolumns.
- Return type:
None