brain_pipe.save.base.Save¶
- class Save(clear_output=False, overwrite=False, *args, **kwargs)¶
Bases:
PipelineStep
,ABC
Base class for all save steps.
- __init__(clear_output=False, overwrite=False, *args, **kwargs)¶
Create a new Save instance.
- Parameters:
clear_output (bool) – Whether to clear the output data_dict after saving. This can save space when save is the last step in a pipeline.
overwrite (bool) – Whether to overwrite existing files.
args (Sequence[Any]) – Additional positional arguments for PipelineStep.
kwargs (Dict[Any, Any]) – Additional keyword arguments for PipelineStep.
Methods
__init__
([clear_output, overwrite])Create a new Save instance.
is_already_done
(data_dict)Check if the step was already done.
is_reloadable
(data_dict)Check if the data can be reloaded.
parse_dict_keys
(key[, name, ...])Parse a key or a sequence of keys.
reload
(data_dict)Reload the data.
- parse_dict_keys(key: str | Sequence[str] | Mapping[str, str], name='key', require_ordered_dict=False) OrderedDict[str, str] ¶
Parse a key or a sequence of keys.
- Parameters:
- Returns:
A mapping of input keys to output keys.
- Return type:
- Raises:
TypeError – If the key is not a string, a sequence of strings or a mapping of strings. If the key is a mapping but require_ordered_dict is True and the mapping is not an OrderedDict.