vipr.plugins.api.plot_scripts package¶
Module contents¶
Plot Script Registry for VIPR Framework.
Plugins register standalone plot scripts here so the script exporter can copy them alongside exported data into the result directory. Scientists can then run these scripts without a VIPR installation.
- Usage (in plugin load()):
from vipr.plugins.api.plot_scripts import register_plot_script from pathlib import Path
- def load(app):
- register_plot_script(
‘my_plot’, Path(__file__).parent / ‘plot_scripts’ / ‘my_plot.py’, dependencies=[‘matplotlib>=3.5.0’, ‘numpy>=1.21.0’]
)
- vipr.plugins.api.plot_scripts.get_plot_script(name: str) dict¶
Retrieve a registered plot script entry.
- Parameters:
name – Script name as passed to register_plot_script()
- Returns:
Dict with keys ‘path’ (Path) and ‘dependencies’ (list[str])
- Raises:
ValueError – If script is not registered
- vipr.plugins.api.plot_scripts.list_registered_scripts() list[str]¶
Return sorted list of all registered script names.
- vipr.plugins.api.plot_scripts.register_plot_script(name: str, script_path: Path, dependencies: list[str] | None = None) None¶
Register a plot script under a given name.
- Parameters:
name – Unique script name used in ImageBuilder.set_plot_script()
script_path – Absolute Path to the .py file
dependencies – List of pip requirement strings (e.g. ‘matplotlib>=3.5.0’)
- Raises:
FileNotFoundError – If script_path does not exist