MODULE REFERENCE

mounted

anomx.data.sources.mounted

Read versioned external dataset selections through a local storage mount.

DCacheDataset

DCacheDataset(reference: str, *, mount_root: str | Path, client: DatasetClient | PlatformClient | None = None)

Bases: MountedDataset

Native dCache reads on Maxwell or another node with a dCache mount.

Signature parameters
ParameterTypeDefault
referencestrrequired
mount_rootkeyword onlystr | Pathrequired
clientkeyword onlyDatasetClient | PlatformClient | NoneNone

Members

sourcesmethod
sources() -> tuple[MountedSource, ...]

Returns tuple[MountedSource, ...]

DatasetSourceChanged

DatasetSourceChanged

Bases: ValueError

A mounted source no longer matches its resolved metadata.

MountedDataset

MountedDataset(reference: str, *, mount_root: str | Path, client: DatasetClient | PlatformClient | None = None)

Bases: Dataset

Use an authorized platform dataset through a native read-only mount.

mount_root is the local equivalent of the integration's starting folder, NOT the selected dataset subfolder. It is explicit because storage mounts differ between facilities. Metadata access still uses the normal Dataset client or Work callbacks, and the resolved manifest is pinned for this object.

Signature parameters
ParameterTypeDefault
referencestrrequired
mount_rootkeyword onlystr | Pathrequired
clientkeyword onlyDatasetClient | PlatformClient | NoneNone

Members

sourcesmethod
sources() -> tuple[MountedSource, ...]

Return the selected files after validating the manifest's version.

Returns tuple[MountedSource, ...]

MountedSource

MountedSource(mount_root: Path, entry: Mapping[str, Any], dataset_version: str)

One read-only file pinned by a dataset manifest.

Size and modification time are checked before and after each opened read. WebDAV ETags are retained as provenance, not interpreted as content hashes. sha256() provides an explicit content fingerprint when required.

Signature parameters
ParameterTypeDefault
mount_rootPathrequired
entryMapping[str, Any]required
dataset_versionstrrequired

Members

mount_rootattribute
entryattribute
entry: Mapping[str, Any]
dataset_versionattribute
source_pathproperty
source_path: str

Return the integration-relative source path.

Returns str

pathproperty
path: Path

Resolve the path inside the explicitly configured mount root.

Returns Path

openmethod
open() -> Iterator[BinaryIO]

Open only in binary read mode and check the opened file's identity.

Returns Iterator[BinaryIO]

sha256method
sha256() -> str

Hash the source in bounded chunks without writing or copying it.

Returns str

iter_numpymethod
iter_numpy(batch_size: int = 128) -> Iterator[np.ndarray]

Yield copied numeric first-axis NPY batches through a read-only mapping.

Signature parameters
ParameterTypeDefault
batch_sizeint128

Returns Iterator[np.ndarray]