dacapo.store.local_array_store

Attributes

logger

Classes

LocalArrayStore

A local array store that uses zarr containers.

Module Contents

dacapo.store.local_array_store.logger
class dacapo.store.local_array_store.LocalArrayStore(basedir)

A local array store that uses zarr containers.

basedir

The base directory where the store will write data.

best_validation_array()

Get the array identifier for the best validation array.

validation_prediction_array()

Get the array identifier for a particular validation prediction.

validation_output_array()

Get the array identifier for a particular validation output.

validation_input_arrays()

Get the array identifiers for the validation input raw/gt.

snapshot_container()

Get a container identifier for storage of a snapshot.

validation_container()

Get a container identifier for storage of a validation.

remove()

Remove a dataset from a container.

basedir
best_validation_array(run_name: str, criterion: str, index: str | None = None) dacapo.store.array_store.LocalArrayIdentifier

Get the array identifier for the best validation array.

Parameters:
  • run_name (str) – The name of the run.

  • criterion (str) – The criterion for the validation array.

  • index (str, optional) – The index of the validation array. Defaults to None.

Returns:

The array identifier for the best validation array.

Return type:

LocalArrayIdentifier

Raises:

ValueError – If the container does not exist.

Examples

>>> store.best_validation_array("run1", "loss")
validation_prediction_array(run_name: str, iteration: int, dataset: str) dacapo.store.array_store.LocalArrayIdentifier

Get the array identifier for a particular validation prediction.

Parameters:
  • run_name (str) – The name of the run.

  • iteration (int) – The iteration of the validation prediction.

  • dataset (str) – The dataset of the validation prediction.

Returns:

The array identifier for the validation prediction.

Return type:

LocalArrayIdentifier

Raises:

ValueError – If the container does not exist.

Examples

>>> store.validation_prediction_array("run1", 0, "train")
validation_output_array(run_name: str, iteration: int, parameters: str, dataset: str) dacapo.store.array_store.LocalArrayIdentifier

Get the array identifier for a particular validation output.

Parameters:
  • run_name (str) – The name of the run.

  • iteration (int) – The iteration of the validation output.

  • parameters (str) – The parameters of the validation output.

  • dataset (str) – The dataset of the validation output.

Returns:

The array identifier for the validation output.

Return type:

LocalArrayIdentifier

Raises:

ValueError – If the container does not exist.

Examples

>>> store.validation_output_array("run1", 0, "params1", "train")
validation_input_arrays(run_name: str, index: str | None = None) Tuple[dacapo.store.array_store.LocalArrayIdentifier, dacapo.store.array_store.LocalArrayIdentifier]

Get the 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 (str) – The name of the run.

  • index (str, optional) – The index of the validation input. Defaults to None.

Returns:

The array identifiers for the validation input raw/gt.

Return type:

Tuple[LocalArrayIdentifier, LocalArrayIdentifier]

Raises:

ValueError – If the container does not exist.

Examples

>>> store.validation_input_arrays("run1")
snapshot_container(run_name: str) dacapo.store.array_store.LocalContainerIdentifier

Get a container identifier for storage of a snapshot.

Parameters:

run_name (str) – The name of the run.

Returns:

The container identifier for the snapshot.

Return type:

LocalContainerIdentifier

Raises:

ValueError – If the container does not exist.

Examples

>>> store.snapshot_container("run1")
validation_container(run_name: str) dacapo.store.array_store.LocalContainerIdentifier

Get a container identifier for storage of a validation.

Parameters:

run_name (str) – The name of the run.

Returns:

The container identifier for the validation.

Return type:

LocalContainerIdentifier

Raises:

ValueError – If the container does not exist.

Examples

>>> store.validation_container("run1")
remove(array_identifier: dacapo.store.array_store.LocalArrayIdentifier) None

Remove a dataset from a container.

Parameters:

array_identifier (LocalArrayIdentifier) – The array identifier of the dataset to remove.

Raises:

ValueError – If the container path does not end with ‘.zarr’.

Examples

>>> store.remove(array_identifier)