ProjectResultRegistry
- class glotaran.project.project_result_registry.ProjectResultRegistry(directory: pathlib.Path)[source]
Bases:
glotaran.project.project_registry.ProjectRegistry
A registry for results.
Initialize a result registry.
- Parameters
directory (Path) – The registry directory.
Attributes Summary
Get the registry directory.
Whether the registry is empty.
Get the items of the registry.
Methods Summary
Create a result name for a model.
Check if the path contains an registry item.
Load an registry item by it's name.
Format the registry items as a markdown text.
List previous result paths with base_name.
Save a result.
Methods Documentation
- property directory: pathlib.Path
Get the registry directory.
- Returns
The registry directory.
- Return type
Path
- property empty: bool
Whether the registry is empty.
- Returns
Whether the registry is empty.
- Return type
- is_item(path: pathlib.Path) bool [source]
Check if the path contains an registry item.
- Parameters
path (Path) – The path to check.
- Returns
Whether the path contains an item.
- Return type
- load_item(name: str) Any
Load an registry item by it’s name.
- Parameters
name (str) – The item name.
- Returns
The loaded item.
- Return type
Any
- Raises
ValueError – Raise if the item does not exist.
- markdown(join_indentation: int = 0) glotaran.utils.ipython.MarkdownStr
Format the registry items as a markdown text.
- previous_result_paths(base_name: str) list[Path] [source]
List previous result paths with base_name.
- result_pattern = re.compile('.+_run_\\d{4}$')