dacapo.store.array_store
Classes
Represents a local array identifier. |
|
Represents a local container identifier. |
|
Base class for array stores. |
Module Contents
- class dacapo.store.array_store.LocalArrayIdentifier
Represents a local array identifier.
- container
The path to the container.
- Type:
Path
- dataset
The dataset name.
- Type:
str
- Method:
__str__ : Returns the string representation of the identifier.
- container: upath.UPath
- dataset: str
- class dacapo.store.array_store.LocalContainerIdentifier
Represents a local container identifier.
- container
The path to the container.
- Type:
Path
- Method:
array_identifier : Creates a local array identifier for the given dataset.
- container: upath.UPath
- array_identifier(dataset) LocalArrayIdentifier
Creates a local array identifier for the given dataset.
- Parameters:
dataset – The dataset for which to create the array identifier.
- Returns:
The local array identifier.
- Return type:
- Raises:
TypeError – If the dataset is not a string.
Examples
>>> container = Path('path/to/container') >>> container.array_identifier('dataset') LocalArrayIdentifier(container=Path('path/to/container'), dataset='dataset')
- class dacapo.store.array_store.ArrayStore
Base class for array stores.
Creates identifiers for the caller to create and write arrays. Provides only rudimentary support for IO itself (currently only to remove arrays).
- container
The path to the container.
- Type:
Path
- dataset
The dataset name.
- Type:
str
- Method:
__str__ : Returns the string representation of the identifier.
- abstract validation_prediction_array(run_name: str, iteration: int, dataset: str) LocalArrayIdentifier
Get the array identifier for a particular validation prediction.
- Parameters:
run_name – The name of the run.
iteration – The iteration number.
dataset – The dataset name.
- Returns:
The array identifier.
- Return type:
- Raises:
NotImplementedError – If the method is not implemented.
Examples
>>> validation_prediction_array('run_name', 1, 'dataset') LocalArrayIdentifier(container=Path('path/to/container'), dataset='dataset')
- abstract validation_output_array(run_name: str, iteration: int, parameters: str, dataset: str) LocalArrayIdentifier
Get the array identifier for a particular validation output.
- Parameters:
run_name – The name of the run.
iteration – The iteration number.
parameters – The parameters.
dataset – The dataset name.
- Returns:
The array identifier.
- Return type:
- Raises:
NotImplementedError – If the method is not implemented.
Examples
>>> validation_output_array('run_name', 1, 'parameters', 'dataset') LocalArrayIdentifier(container=Path('path/to/container'), dataset='dataset')
- abstract validation_input_arrays(run_name: str, index: str | None = None) Tuple[LocalArrayIdentifier, LocalArrayIdentifier]
Get an array identifiers for the validation input raw/gt.
It would be nice to store raw/gt with the validation predictions/outputs. If we don’t store these we would have to look up the datasplit config and figure out where to find the inputs for each run. If we write the data then we don’t need to search for it. This convenience comes at the cost of some extra memory usage.
- Parameters:
run_name – The name of the run.
index – The index of the validation input.
- Returns:
The array identifiers.
- Return type:
- Raises:
NotImplementedError – If the method is not implemented.
Examples
>>> validation_input_arrays('run_name', 'index') (LocalArrayIdentifier(container=Path('path/to/container'), dataset='dataset'), LocalArrayIdentifier(container=Path('path/to/container'), dataset='dataset'))
- abstract remove(array_identifier: LocalArrayIdentifier) None
Remove an array by its identifier.
- Parameters:
array_identifier – The array identifier.
- Raises:
NotImplementedError – If the method is not implemented.
Examples
>>> remove(LocalArrayIdentifier(container=Path('path/to/container'), dataset='dataset'))
- abstract snapshot_container(run_name: str) LocalContainerIdentifier
Get a container identifier for storage of a snapshot.
- Parameters:
run_name – The name of the run.
- Returns:
The container identifier.
- Return type:
- Raises:
NotImplementedError – If the method is not implemented.
Examples
>>> snapshot_container('run_name') LocalContainerIdentifier(container=Path('path/to/container'))
- abstract validation_container(run_name: str) LocalContainerIdentifier
Get a container identifier for storage of a snapshot.
- Parameters:
run_name – The name of the run.
- Returns:
The container identifier.
- Return type:
- Raises:
NotImplementedError – If the method is not implemented.
Examples
>>> validation_container('run_name') LocalContainerIdentifier(container=Path('path/to/container'))