API: vaft.gui
Generated from each module's __all__ by python -m vaft._api_catalog:
73 published objects in 17 modules.
Signatures and summaries are read from the source; nothing here is written by hand.
All API pages
No object matches.
vaft.deploy.gui.smoke
Smoke checks for a hosted vaft gui (#1862): python -m vaft.deploy.gui.smoke URL.
main
function
source
main(argv: Iterable[str] | None = None) -> int
run_checks
function
source
run_checks(url: str, *, username: str | None = None, password: str | None = None, insecure: bool = False) -> list[tuple[str, bool, str]]
Run the checks against url (the page, e.g. https://host/gui-test/).
vaft.gui
Browser GUI over the public VAFT APIs (#1086, roadmap #1359).
require_panel
function
source
require_panel() -> Any
panel, or an ImportError saying how to get it back.
vaft.gui.app
The reference browser application: pick sources, a plot and its controls (#1086).
AUTH_MODES
data
AUTH_MODES = ('auto', 'password', 'hsds', 'none')
BrowserApp
class
source
BrowserApp(session: BrowserSession | None = None, *, plot: str | None = None, hosted: bool = False, touch: bool | None = None) -> None
Source picker, plot selector, controls, figure settings and the figure.
Also exported as vaft.gui.BrowserApp.
13 members
requested_sourcesmethod — The sources the source widgets currently name. sourcechoosemethod — Putsourcesin the source widgets, as if the reader had chosen them. sourceloadmethod — Opensourcesand draw their first plot;Falsewhen it failed. sourceselected_timemethod — The time the plot on screen is showing, as its control labels it. sourceset_plot_filtermethod — Offer only the plotsplot_filteraccepts, and draw the first if the one on screen is not. sourceshowmethod — Drawnamewith its controls;Falsewhen it could not be drawn. sourcefigureproperty — The pane showing the current plot. sourceapply_optionsmethod — Draw what is on screen withoptions;False(and nothing kept) when refused. sourcedraw_compositionmethod — Draw the editor’s composition;Falsewhen it was refused. sourcesidebarmethod sourcemainmethod sourceviewmethod — The page served byvaft gui. sourceclosemethod source
build_app
function
source
build_app(*, sample: int | Sequence[int] | None = None, file: str | None = None, shot: int | Sequence[int] | None = None, namespace: str | None = None, plot: str | None = None, hosted: bool = False) -> BrowserApp
A BrowserApp, with one kind of source loaded when the page opens.
Also exported as vaft.gui.build_app.
build_shell
function
source
build_shell(*, workspace: str | None = None, hosted: bool = False, **app_options: Any) -> Any
The page vaft gui serves: the vaft.gui.shell.Shell with every workspace.
Also exported as vaft.gui.build_shell.
LOOPBACK
data
LOOPBACK = frozenset({'127.0.0.1', '::1', 'localhost'})
parse_shots
function
source
parse_shots(text: str) -> list[int]
Shot numbers from "39915, 41524 41672"; ranges are not expanded.
PLOTLY_CONFIG
data
PLOTLY_CONFIG = <builtins.dict>
serve
function
source
serve(*, address: str = '127.0.0.1', port: int = 5006, show: bool | None = None, websocket_origin: Sequence[str] | None = None, auth: str = 'auto', password: str | None = None, hosted: bool = False, prefix: str | None = None, **app_options: Any) -> Any
Serve build_app until interrupted; one app per browser session.
Also exported as vaft.gui.serve.
session_page
function
source
session_page(*, hosted: bool = False, **app_options: Any) -> Callable[[], Any]
The page factory serve hands Panel: one Shell per browser session.
TIME_CONTROLS
data
TIME_CONTROLS = ('time_slice', 'time_index', 'time')
vaft.gui.auth
Sign in to the GUI with an HSDS account (vaft gui --auth hsds).
check_hsds_login
function
source
check_hsds_login(username: str, password: str, endpoint: str, *, timeout: float = 5.0) -> bool
Whether HSDS at endpoint accepts username / password.
hsds_auth_provider
function
source
hsds_auth_provider(endpoint: str) -> Any
A Panel auth provider whose login form signs in with an HSDS account.
hsds_endpoint
function
source
hsds_endpoint() -> str
The endpoint h5pyd reads from: $HS_ENDPOINT, else the active .hscfg.
TIMEOUT_S
data
TIMEOUT_S = 5.0
vaft.gui.catalog_view
How the plot explorer presents a discovery catalog (#1172).
describe
function
source
describe(record: Any) -> str
The discovery record as Markdown: identity, availability, data, controls.
group_options
function
source
group_options(records: Iterable[Any], *, unavailable: bool = False, names: set[str] | None = None) -> dict[str, dict[str, str]]
{subject heading: {label: plot name}} in catalog order.
matching_names
function
source
matching_names(query: str | None, records: Iterable[Any] = ()) -> set[str] | None
The plots a search names; None for no search.
plot_label
function
source
plot_label(record: Any) -> str
view / quantity (view alone when there is no quantity).
UNAVAILABLE
data
UNAVAILABLE = ' (unavailable)'
vaft.gui.composer
The composition editor: several plots arranged into one figure (#1467, phase 5).
CompositionEditor
class
source
CompositionEditor(on_draw: Callable[[Any], None]) -> None
Widgets that build a vaft.plot.FigureComposition.
EMPTY
data
EMPTY = '(empty)'
PRESETS
data
PRESETS = <builtins.dict>
vaft.gui.diagnostics
The Routine Diagnostics workspace (#1348): processed diagnostics, by diagnostic.
describe_diagnostic
function
source
describe_diagnostic(key: str, record: Mapping[str, Any], names: Iterable[str]) -> str
The registry record as Markdown, with the plots the workspace offers.
diagnostic_plots
function
source
diagnostic_plots(record: Mapping[str, Any], plots: Iterable[Any]) -> list[str]
The plots (discovery records) of the diagnostic’s own data.
diagnostics_by_category
function
source
diagnostics_by_category(registry: Mapping[str, Mapping[str, Any]], plots: Iterable[Any]) -> dict[str, dict[str, str]]
{category: {display name: registry id}} for the diagnostics that have plots.
DiagnosticsWorkspace
class
source
DiagnosticsWorkspace(shell: Any, app: Any = None, registry: Mapping[str, Any] | None = None) -> None
The plot explorer narrowed to one diagnostic chosen from the registry.
vaft.gui.equilibrium
The Equilibrium workspace (#1352): inspect, constraints, time, quality.
EquilibriumWorkspace
class
source
EquilibriumWorkspace(shell: Any, app: Any = None) -> None
The plot explorer over equilibrium plots, by mode, sharing one time slice.
is_equilibrium
function
source
is_equilibrium(record: Any) -> bool
Whether a discovery record is a plot of the equilibrium.
mode_of
function
source
mode_of(record: Any) -> str
The mode a plot is shown under ("inspect" when no rule claims it).
MODES
data
MODES = <builtins.dict>
quality_markdown
function
source
quality_markdown(label: str, report: Mapping[str, Any]) -> str
A validation report as Markdown: the summary per category, then every check.
quality_rows
function
source
quality_rows(report: Mapping[str, Any]) -> list[dict[str, str]]
One row per check of a validation report: category, check, status, reason.
vaft.gui.figure
What the browser pane does with a figure: its display size and the export formats (image and video).
DisplaySize
class
source
DisplaySize(width: int | None = None, height: int | None = None) -> None
The preview pane’s width and height in pixels; None fits the page.
2 fields
width: int | Noneheight: int | None
EXPORT_FORMATS
data
EXPORT_FORMATS = ('png', 'svg', 'pdf')
VIDEO_FORMATS
data
VIDEO_FORMATS = ('mp4', 'webm', 'gif')
vaft.gui.layout
One page for every screen: the responsive rules of vaft gui (#1865).
is_touch_request
function
source
is_touch_request(headers: Any) -> bool
Whether the page’s request came from a phone or tablet browser.
page
function
source
page(sidebar: list[Any], main: list[Any], *, title: str = 'VAFT', **template: Any) -> Any
The template every vaft gui page uses, with the responsive rules.
PHONE_MAX_WIDTH
data
PHONE_MAX_WIDTH = 767
PHONE_QUERY
data
PHONE_QUERY = '(max-width: 767px), (max-height: 500px) and (max-width: 950px)'
PHONE_START_JS
data
PHONE_START_JS = "// vaft gui: on a phone, open on the figure (#1865)\nwindow.addEventListener('load', function () { if (!window.matc...
RESPONSIVE_CSS
data
RESPONSIVE_CSS = '\n@media (max-width: 1100px) {\n #sidebar:not(.hidden) { min-width: 300px; max-width: 300px; }\n}\n@media (max-widt...
scrolling_markdown
function
source
scrolling_markdown(text: str = '', **options: Any) -> Any
A Markdown pane that keeps a wide table inside a horizontal scroll box.
SIDEBAR_WIDTH
data
SIDEBAR_WIDTH = 360
TABLET_MAX_WIDTH
data
TABLET_MAX_WIDTH = 1100
VIEWPORT
data
VIEWPORT = 'width=device-width, initial-scale=1'
vaft.gui.options_form
The Figure Options form, generated from vaft.plot.FigureOptions (#1421).
FigureOptionsForm
class
source
FigureOptionsForm(on_change: Callable[['FigureOptionsForm'], None] | None = None) -> None
Widgets for every vaft.plot.FigureOptions field, grouped in cards.
4 members
valuemethod — TheFigureOptionsthe widgets say;ValueErrorwhen refused. sourceshowmethod — Put the widgets onoptionswithout reporting a change. sourceresetmethod — Every field back to inherited (not to the value it resolved to). sourcecardsmethod — One collapsed card per section, More last for fields no section names. source
INHERIT
data
INHERIT = '(inherited)'
LABELS
data
LABELS = <builtins.dict>
SECTIONS
data
SECTIONS = <builtins.dict>
vaft.gui.reproduce
Reproduce the figure on screen: Python, CLI, or Python with Pylustrator (#1421).
ReproducePanel
class
source
ReproducePanel(request: Callable[[], Any], *, on_error: Callable[[BaseException], Any] | None = None) -> None
Format and theme of the reproduced figure, and the code that draws it.
vaft.gui.selection
What the reader has selected, shared by every workspace (#1174).
Selection
class
source
Selection(namespace: str | None = None, sources: tuple[Source, ...] = <factory>, time: str | None = None) -> None
One state of the shared context.
Also exported as vaft.gui.Selection.
3 fields · 1 members
namespace: str | Nonesources: tuple[Source, ...]time: str | Nonelabelproperty — The open entries in words, for a status line. source
SelectionState
class
source
SelectionState(selection: Selection | None = None) -> None
The current Selection, with observers.
Also exported as vaft.gui.SelectionState.
vaft.gui.shell
The application shell: workspaces, shared selection, status (#1174).
register_workspace
function
source
register_workspace(name: str, title: str, factory: Callable[['Shell'], Any], *, description: str = '', order: int = 100, replace: bool = False) -> WorkspaceSpec
Add a workspace to WORKSPACES; returns its spec.
Also exported as vaft.gui.register_workspace.
Shell
class
source
Shell(registry: WorkspaceRegistry | None = None, *, initial: str | None = None, selection: SelectionState | None = None, factories: Mapping[str, Callable[['Shell'], Any]] | None = None, hosted: bool = False) -> None
One browser session’s page: navigation, the active workspace, status.
Also exported as vaft.gui.Shell.
9 members
workspacemethod — The workspacename, built on first use. sourceshowmethod — Makenamethe active workspace; returns it. sourcereportmethod — Show an error above the workspace (and as a toast when Panel offers one). sourceclearmethod sourcecheck_connectionmethod — Ask the database server whether it is ready; returns the state shown. sourcesidebarmethod sourcemainmethod sourceviewmethod — The page served byvaft gui. sourceclosemethod — Close every built workspace, even when one of them fails to. source
WorkspaceRegistry
class
source
WorkspaceRegistry() -> None
The workspaces a shell offers, in navigation order.
Also exported as vaft.gui.WorkspaceRegistry.
WORKSPACES
data
WORKSPACES = <vaft.gui.shell.WorkspaceRegistry>
Also exported as vaft.gui.WORKSPACES.
WorkspaceSpec
class
source
WorkspaceSpec(name: str, title: str, factory: Callable[['Shell'], Any], description: str = '', order: int = 100) -> None
A registered workspace: its key, its title in the navigation, how to build it.
Also exported as vaft.gui.WorkspaceSpec.
5 fields
name: strtitle: strfactory: Callable[['Shell'], Any]description: strorder: int
vaft.gui.state
What the browser shows, kept apart from the widgets that show it (#1086).
BrowserSession
class
source
BrowserSession() -> None
The loaded sources, their catalog and the plot on screen.
Also exported as vaft.gui.BrowserSession.
28 members
databaseproperty — Whether the sources are database shots, loaded IDS by IDS. sourcelabelproperty — What is loaded, for a status line or a file name. sourceopenmethod — Loadsourcesand their catalog; nothing changes unless both succeed. sourceplot_idsmethod — The IDS plotnamereads, with the one that labels a shot. sourceplotted_idsmethod — Every IDS some available plot reads and every open shot stores. sourceheld_idsmethod — The IDS in memory for every open database shot. sourceload_idsmethod — Fetchnamesfor every open database shot; the IDS newly loaded. sourcecatalogmethod — The plots available for the loaded sources. sourcefull_catalogmethod — Every plot the registry supports here, unavailable ones with their reason. sourcecapabilitymethod — The discovery record of plotname(Nonewhen it is not supported here). sourcegrouped_plotsmethod — Available plot names by subject, in catalog order. sourcesupports_plotlymethod — Whethernamedeclares a Plotly renderer in its capability record. sourceselectmethod — Drawnamewith its controls; the previous figure is released. sourcescopemethod — The figure options’ type and line settings in force for a (re)draw. sourcecomposemethod — Drawcompositionfrom the loaded sources; the previous figure is released. sourcerequestmethod — Thevaft.plot.PlotRequestof what is on screen. sourcecall_optionsmethod — The plot call’s keyword arguments for the controls as they stand. sourceintent_optionsmethod — The control values the reader changed:call_optionsless the defaults. sourcecarry_optionsmethod — The controls’ values to redraw the plot with, controls included. sourceexportmethod — What is on screen, drawn by Matplotlib asfmtwith the reader’s options. sourcesequence_controlmethod — The plot’s slice-group control – the sequence a video walks – orNone. sourcesequence_statesmethod — Every state ofsequence_controlfor the plot as drawn, in order; empty without one. sourceexport_videomethod — The on-screen plot over its sequence as anfmtmovie (#1400). sourcevideo_metadatamethod — The provenance of the lastexport_videofile, as JSON: each frame’s state and time. sourcestateproperty sourcefigureproperty sourcereleasemethod — Let go of the plot on screen (the sources stay open). sourceclosemethod — Release the figure and forget the sources. source
load_source
function
source
load_source(source: Source) -> Any
The ODS behind source.
RENDERERS
data
RENDERERS = ('auto', 'plotly', 'matplotlib')
sample_shots
function
source
sample_shots() -> tuple[int, ...]
The packaged samples this install can open.
Source
class
source
Source(kind: str, value: int | str, namespace: str | None = None) -> None
Where the data comes from.
Also exported as vaft.gui.Source.
3 fields · 1 members
kind: strvalue: int | strnamespace: str | Nonelabelproperty source
SOURCE_KINDS
data
SOURCE_KINDS = ('sample', 'file', 'shot')
vaft.gui.widgets
Panel widgets over a plot’s vaft.plot.navigation.ControlState.
INDIVIDUAL_LABEL
data
INDIVIDUAL_LABEL = '(individual channels)'
panel_controls
function
source
panel_controls(state: Any, *, on_error: Callable[[Exception], Any] | None = None, scope: Callable[[], Any] | None = None) -> list[Any]
Panel widgets for every control of state, kept in step with it.
Also exported as vaft.gui.panel_controls.
PLAY_INTERVAL_MS
data
PLAY_INTERVAL_MS = 700
vaft.gui.workspaces
The workspaces vaft gui ships with (#1174).
credential_summary
function
source
credential_summary(path: Any = None, environment: dict[str, str] | None = None) -> dict[str, str]
What h5pyd will connect with, secrets reduced to configured/missing.
DatabaseWorkspace
class
source
DatabaseWorkspace(shell: Shell) -> None
Database sources, credential configuration, connection, opening shots.
PlotWorkspace
class
source
PlotWorkspace(shell: Shell, app: Any = None) -> None
The plot explorer, bound to the shared selection.