phenotypic.gui.results_viewer package#

Interactive results viewer for PhenoTypic CLI output.

Public entry points:

  • create_app() – build a configured dash.Dash instance for an OutputRoot (see phenotypic.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 what python -m phenotypic.gui.results_viewer does.

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()). None triggers the empty-state pathway: the factory skips blueprint registration, FilteredMeasurements.load, and callback registration; app.layout is the empty-state placeholder.

  • url_prefix (str) – Mount-point prefix. Defaults to "/" (standalone launcher); the hub composer passes "/results/". Set as requests_pathname_prefix/routes_pathname_prefix on the Dash constructor and stashed on app.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.Dash instance whose app.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 via phenotypic.gui.results_viewer._app.create_app(), prints a one-shot startup banner with SSH-tunnel and cache-nuke hints, and finally hands control to app.run (which blocks until the user interrupts).

Parameters:
  • output_root (Path | str) – Path to a CLI output directory (the one containing master_measurements.parquet and results/). Strings are accepted for ergonomics; both are resolved to an absolute pathlib.Path. Defaults to the current working directory.

  • host (str) – Interface to bind. DEFAULT_HOST keeps the server loopback-only – pair with SSH port forwarding for remote access. 0.0.0.0 exposes 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_ImageFile columns.

Return type:

None

Subpackages#