Skip to content

state

state

Persistent state for user-defined interface views.

View(id: int, name: str) dataclass

A saved collection of plots for one run.

Plot(id: int, name: str, x: str | None, y: str | None, log_x: bool, log_y: bool, checkpoints: bool, smoothing: float) dataclass

A saved plot definition.

InterfaceState(path: Path | None = None)

Store interface-only view definitions in an XDG state database.

close() -> None

Close the interface database.

views(root: Path, name: str | None = None, nonce: str | None = None) -> list[View]

Return saved run or workspace views in creation order.

Omitting both name and nonce addresses the one cross-cutting view collection owned by root.

add_view(root: Path, name: str | None = None, nonce: str | None = None) -> View

Create a view in a run or root workspace collection.

rename_view(view: View, name: str) -> View

Persist and return a view's new name.

delete_view(view: View) -> None

Delete a view and its plots in one transaction.

plots(view: View) -> list[Plot]

Return a view's saved plots in creation order.

add_plot(view: View) -> Plot

Create and return an empty plot in view.

rename_plot(plot: Plot, name: str) -> Plot

Persist and return a plot's new name.

delete_plot(plot: Plot) -> None

Delete a plot in one transaction.

update_plot(plot: Plot, *, x: str | None, y: str | None, log_x: bool, log_y: bool, checkpoints: bool, smoothing: float) -> Plot

Persist and return a plot's current axis configuration.