File System
The filesystem implementation is a concrete implementation of the abstract copick API that reads and writes data to/from
any storage supported by fsspec
. The filesystem implementation is defined in the copick.impl.filesystem
module.
Metadata Models
copick.impl.filesystem.CopickConfigFSSpec
Bases: CopickConfig
Copick configuration for fsspec-based storage.
Attributes:
-
overlay_root
(str
) –The root URL for the overlay storage.
-
static_root
(Optional[str]
) –The root URL for the static storage.
-
overlay_fs_args
(Optional[Dict[str, Any]]
) –Additional arguments for the overlay filesystem.
-
static_fs_args
(Optional[Dict[str, Any]]
) –Additional arguments for the static filesystem.
Data Entities
copick.impl.filesystem.CopickRootFSSpec
Bases: CopickRoot
CopickRoot class backed by fspec storage.
Attributes:
-
fs_overlay
(AbstractFileSystem
) –The filesystem for the overlay storage.
-
fs_static
(Optional[AbstractFileSystem]
) –The filesystem for the static storage.
-
root_overlay
(str
) –The root path for the overlay storage.
-
root_static
(Optional[str]
) –The root path for the static storage.
__init__(config: CopickConfigFSSpec)
Parameters:
-
config
(CopickConfigFSSpec
) –Copick configuration for fsspec-based storage.
from_file(path: str) -> CopickRootFSSpec
Initialize a CopickRootFSSpec from a configuration file on disk.
Parameters:
-
path
(str
) –Path to the configuration file on disk.
Returns:
-
CopickRootFSSpec
(CopickRootFSSpec
) –The initialized CopickRootFSSpec object.
copick.impl.filesystem.CopickObjectFSSpec
Bases: CopickObjectOverlay
CopickObject class backed by fsspec storage.
Attributes:
-
path
(str
) –The path to the object file.
-
fs
(AbstractFileSystem
) –The filesystem containing the object file.
zarr() -> Union[None, zarr.storage.FSStore]
Get the zarr store for the object.
Returns:
-
Union[None, FSStore]
–Union[None, zarr.storage.FSStore]: The zarr store for the object, or None if the object is not a particle.
copick.impl.filesystem.CopickRunFSSpec
Bases: CopickRunOverlay
CopickRun class backed by fsspec storage.
Attributes:
-
static_path
(str
) –The path to the run on the static source.
-
overlay_path
(str
) –The path to the run on the overlay source.
-
fs_static
(AbstractFileSystem
) –The filesystem containing the run on the static source.
-
fs_overlay
(AbstractFileSystem
) –The filesystem containing the run on the overlay source.
-
static_is_overlay
(bool
) –Whether the static and overlay sources are the same.
ensure(create: bool = False) -> bool
Checks if the run record exists in the static or overlay directory, optionally creating it in the overlay filesystem if it does not.
Parameters:
-
create
(bool
, default:False
) –Whether to create the run record if it does not exist.
Returns:
-
bool
(bool
) –True if the run record exists, False otherwise.
copick.impl.filesystem.CopickPicksFSSpec
Bases: CopickPicksOverlay
CopickPicks class backed by fsspec storage.
Attributes:
-
path
(str
) –The path to the picks file.
-
directory
(str
) –The directory containing the picks file.
-
fs
(AbstractFileSystem
) –The filesystem containing the picks file.
copick.impl.filesystem.CopickMeshFSSpec
Bases: CopickMeshOverlay
CopickMesh class backed by fspec storage.
Attributes:
-
path
(str
) –The path to the mesh file.
-
directory
(str
) –The directory containing the mesh file.
-
fs
(AbstractFileSystem
) –The filesystem containing the mesh file.
copick.impl.filesystem.CopickSegmentationFSSpec
Bases: CopickSegmentationOverlay
CopickSegmentation class backed by fsspec storage.
Attributes:
-
filename
(str
) –The filename of the segmentation file.
-
path
(str
) –The path to the segmentation file.
-
fs
(AbstractFileSystem
) –The filesystem containing the segmentation file.
zarr() -> zarr.storage.FSStore
Get the zarr store for the segmentation object.
Returns:
-
FSStore
–zarr.storage.FSStore: The zarr store for the segmentation object.
copick.impl.filesystem.CopickVoxelSpacingFSSpec
Bases: CopickVoxelSpacingOverlay
CopickVoxelSpacing class backed by fsspec storage.
Attributes:
-
static_path
(str
) –The path to the voxel spacing on the static source.
-
overlay_path
(str
) –The path to the voxel spacing on the overlay source.
-
fs_static
(AbstractFileSystem
) –The filesystem containing the voxel spacing on the static source.
-
fs_overlay
(AbstractFileSystem
) –The filesystem containing the voxel spacing on the overlay source.
-
static_is_overlay
(bool
) –Whether the static and overlay sources are the same.
ensure(create: bool = False) -> bool
Checks if the voxel spacing record exists in the static or overlay directory, optionally creating it in the overlay filesystem if it does not.
Parameters:
-
create
(bool
, default:False
) –Whether to create the voxel spacing record if it does not exist.
Returns:
-
bool
(bool
) –True if the voxel spacing record exists, False otherwise.
copick.impl.filesystem.CopickTomogramFSSpec
Bases: CopickTomogramOverlay
CopickTomogram class backed by fsspec storage.
Attributes:
-
static_path
(str
) –The path to the tomogram on the static source.
-
overlay_path
(str
) –The path to the tomogram on the overlay source.
-
static_stem
(str
) –The stem of the tomogram on the static source.
-
overlay_stem
(str
) –The stem of the tomogram on the overlay source.
-
fs_static
(AbstractFileSystem
) –The filesystem containing the tomogram on the static source.
-
fs_overlay
(AbstractFileSystem
) –The filesystem containing the tomogram on the overlay source.
-
static_is_overlay
(bool
) –Whether the static and overlay sources are the same.
zarr() -> zarr.storage.FSStore
Get the zarr store for the tomogram object.
Returns:
-
FSStore
–zarr.storage.FSStore: The zarr store for the tomogram object.
copick.impl.filesystem.CopickFeaturesFSSpec
Bases: CopickFeaturesOverlay
CopickFeatures class backed by fsspec storage.
Attributes:
-
path
(str
) –The path to the features file.
-
fs
(AbstractFileSystem
) –The filesystem containing the features file.
zarr() -> zarr.storage.FSStore
Get the zarr store for the features object.
Returns:
-
FSStore
–zarr.storage.FSStore: The zarr store for the features object.