nirs4all.workspace package
Submodules
Module contents
Workspace management for nirs4all.
Provides: - Library management for saving and loading pipeline templates and trained models. - Active workspace path management for run output storage.
- class nirs4all.workspace.LibraryManager(library_dir: Path)[source]
Bases:
objectManage library of saved pipelines.
- list_filtered() List[Dict][source]
List all filtered pipelines.
- Returns:
List of metadata dictionaries
- list_fullruns() List[Dict][source]
List all saved full runs.
- Returns:
List of metadata dictionaries
- list_pipelines() List[Dict][source]
List all full pipelines.
- Returns:
List of metadata dictionaries
- list_templates() List[Dict][source]
List all available templates.
- Returns:
List of template dictionaries
- load_template(name: str) Dict[source]
Load a template by name.
- Parameters:
name – Template name
- Returns:
Template dictionary
- save_filtered(pipeline_dir: Path, name: str, description: str = '') Path[source]
Save filtered pipeline (config + metrics only).
Useful for tracking experiments and comparing configurations.
- Parameters:
pipeline_dir – Source pipeline directory
name – Save name
description – Optional description
- Returns:
Path to saved filtered pipeline
- save_fullrun(run_dir: Path, name: str, description: str = '') Path[source]
Save entire run (all pipelines + binaries + data).
Useful for complete experiment archiving and cross-dataset comparison.
- Parameters:
run_dir – Run directory to save
name – Save name
description – Optional description
- Returns:
Path to saved run
- save_pipeline_full(run_dir: Path, pipeline_dir: Path, name: str, description: str = '') Path[source]
Save full pipeline (all files + binaries).
Useful for deployment, retraining, and full reproducibility.
- Parameters:
run_dir – Parent run directory (contains _binaries/)
pipeline_dir – Pipeline directory
name – Save name
description – Optional description
- Returns:
Path to saved pipeline
- save_template(pipeline_config: Dict, name: str, description: str = '') Path[source]
Save pipeline template (config only, no trained artifacts).
- Parameters:
pipeline_config – Pipeline configuration dictionary
name – Template name
description – Optional description
- Returns:
Path to saved template file
- nirs4all.workspace.get_active_workspace() Path[source]
Get the active workspace path.
Resolution order: 1. Explicitly set via set_active_workspace() 2. NIRS4ALL_WORKSPACE environment variable 3. ./workspace in current working directory (default)
- Returns:
Path to the active workspace directory.