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

vaft.deploy.gui.smoke
mainfunction
run_checksfunction
vaft.gui
require_panelfunction
vaft.gui.app
AUTH_MODESdata
BrowserAppclass
build_appfunction
build_shellfunction
LOOPBACKdata
parse_shotsfunction
PLOTLY_CONFIGdata
servefunction
session_pagefunction
TIME_CONTROLSdata
vaft.gui.auth
check_hsds_loginfunction
hsds_auth_providerfunction
hsds_endpointfunction
HSDSUnavailableclass
TIMEOUT_Sdata
vaft.gui.catalog_view
describefunction
group_optionsfunction
matching_namesfunction
plot_labelfunction
UNAVAILABLEdata
vaft.gui.composer
CompositionEditorclass
EMPTYdata
PRESETSdata
vaft.gui.diagnostics
describe_diagnosticfunction
diagnostic_plotsfunction
diagnostics_by_categoryfunction
DiagnosticsWorkspaceclass
vaft.gui.equilibrium
EquilibriumWorkspaceclass
is_equilibriumfunction
mode_offunction
MODESdata
quality_markdownfunction
quality_rowsfunction
vaft.gui.figure
DisplaySizeclass
EXPORT_FORMATSdata
VIDEO_FORMATSdata
vaft.gui.layout
is_touch_requestfunction
pagefunction
PHONE_MAX_WIDTHdata
PHONE_QUERYdata
PHONE_START_JSdata
RESPONSIVE_CSSdata
scrolling_markdownfunction
SIDEBAR_WIDTHdata
TABLET_MAX_WIDTHdata
VIEWPORTdata
vaft.gui.options_form
FigureOptionsFormclass
INHERITdata
LABELSdata
SECTIONSdata
vaft.gui.reproduce
ReproducePanelclass
vaft.gui.selection
Selectionclass
SelectionStateclass
vaft.gui.shell
register_workspacefunction
Shellclass
WorkspaceRegistryclass
WORKSPACESdata
WorkspaceSpecclass
vaft.gui.state
BrowserSessionclass
load_sourcefunction
RENDERERSdata
sample_shotsfunction
Sourceclass
SOURCE_KINDSdata
vaft.gui.widgets
INDIVIDUAL_LABELdata
panel_controlsfunction
PLAY_INTERVAL_MSdata
vaft.gui.workspaces
credential_summaryfunction
DatabaseWorkspaceclass
PlotWorkspaceclass

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_sources method — The sources the source widgets currently name. source
  • choose method — Put sources in the source widgets, as if the reader had chosen them. source
  • load method — Open sources and draw their first plot; False when it failed. source
  • selected_time method — The time the plot on screen is showing, as its control labels it. source
  • set_plot_filter method — Offer only the plots plot_filter accepts, and draw the first if the one on screen is not. source
  • show method — Draw name with its controls; False when it could not be drawn. source
  • figure property — The pane showing the current plot. source
  • apply_options method — Draw what is on screen with options; False (and nothing kept) when refused. source
  • draw_composition method — Draw the editor’s composition; False when it was refused. source
  • sidebar method source
  • main method source
  • view method — The page served by vaft gui. source
  • close method 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.

HSDSUnavailable

class source

HSDS gave no verdict on an account: unreachable, or an unexpected answer.

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.

4 members
  • set_plots method — The plots a cell may hold: the catalog of the loaded sources. source
  • assign method — Fill the cells row by row; None leaves one empty. source
  • composition method — The FigureComposition the widgets say; ValueError when invalid. source
  • widgets method source

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.

4 members
  • plots_of method — The registered plots of diagnostic key. source
  • choose method — Narrow the explorer to diagnostic key. source
  • sidebar method source
  • main method source

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.

4 members
  • set_mode method source
  • run_checks method — Validate the open equilibria (this slice, or every slice); returns the reports. source
  • sidebar method source
  • main method source

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 | None
  • height: 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
  • value method — The FigureOptions the widgets say; ValueError when refused. source
  • show method — Put the widgets on options without reporting a change. source
  • reset method — Every field back to inherited (not to the value it resolved to). source
  • cards method — 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.

3 members
  • presentation method — The format/theme the reader chose, leaving inherited ones out. source
  • write method — Fill the text box with the kind of reproduction and return it. source
  • widgets method source

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 | None
  • sources: tuple[Source, ...]
  • time: str | None
  • label property — 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.

3 members
  • value property source
  • update method — Change fields of the selection; returns whether it changed. source
  • subscribe method — Call callback(selection, origin) after every change; returns an unsubscribe. source

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
  • workspace method — The workspace name, built on first use. source
  • show method — Make name the active workspace; returns it. source
  • report method — Show an error above the workspace (and as a toast when Panel offers one). source
  • clear method source
  • check_connection method — Ask the database server whether it is ready; returns the state shown. source
  • sidebar method source
  • main method source
  • view method — The page served by vaft gui. source
  • close method — 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.

4 members

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: str
  • title: str
  • factory: Callable[['Shell'], Any]
  • description: str
  • order: 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
  • database property — Whether the sources are database shots, loaded IDS by IDS. source
  • label property — What is loaded, for a status line or a file name. source
  • open method — Load sources and their catalog; nothing changes unless both succeed. source
  • plot_ids method — The IDS plot name reads, with the one that labels a shot. source
  • plotted_ids method — Every IDS some available plot reads and every open shot stores. source
  • held_ids method — The IDS in memory for every open database shot. source
  • load_ids method — Fetch names for every open database shot; the IDS newly loaded. source
  • catalog method — The plots available for the loaded sources. source
  • full_catalog method — Every plot the registry supports here, unavailable ones with their reason. source
  • capability method — The discovery record of plot name (None when it is not supported here). source
  • grouped_plots method — Available plot names by subject, in catalog order. source
  • supports_plotly method — Whether name declares a Plotly renderer in its capability record. source
  • select method — Draw name with its controls; the previous figure is released. source
  • scope method — The figure options’ type and line settings in force for a (re)draw. source
  • compose method — Draw composition from the loaded sources; the previous figure is released. source
  • request method — The vaft.plot.PlotRequest of what is on screen. source
  • call_options method — The plot call’s keyword arguments for the controls as they stand. source
  • intent_options method — The control values the reader changed: call_options less the defaults. source
  • carry_options method — The controls’ values to redraw the plot with, controls included. source
  • export method — What is on screen, drawn by Matplotlib as fmt with the reader’s options. source
  • sequence_control method — The plot’s slice-group control – the sequence a video walks – or None. source
  • sequence_states method — Every state of sequence_control for the plot as drawn, in order; empty without one. source
  • export_video method — The on-screen plot over its sequence as an fmt movie (#1400). source
  • video_metadata method — The provenance of the last export_video file, as JSON: each frame’s state and time. source
  • state property source
  • figure property source
  • release method — Let go of the plot on screen (the sources stay open). source
  • close method — 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: str
  • value: int | str
  • namespace: str | None
  • label property 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.

6 members
  • close method source
  • refresh_credentials method source
  • check method source
  • open_shots method — Open the typed shots from the chosen namespace in the plot explorer. source
  • sidebar method source
  • main method source

PlotWorkspace

class source
PlotWorkspace(shell: Shell, app: Any = None) -> None

The plot explorer, bound to the shared selection.

5 members
  • request method — Open sources when the reader comes here (now, if this workspace is shown). source
  • activate method source
  • sidebar method source
  • main method source
  • close method source

results matching ""

    No results matching ""