PyTorch¶
rddac.pytorch.RDDACDataset is a torch.utils.data.IterableDataset over a Croissant view. It is available only when the [torch] extra is installed (see Installation).
RDDACDataset¶
RDDACDataset
¶
Bases: DDACSDataset
Streaming PyTorch dataset for a single RDDAC Croissant view.
Yields a dict[str, numpy.ndarray] per experiment. Field selection is
derived from the Croissant view + field-map; sharding across DataLoader
workers and DDP ranks is decided inside __iter__, so the same instance
works under num_workers=0, num_workers=N and DDP.
Views must source field-map (HDF5) fields only; for views that include
process-parameters metadata columns use rddac.streaming.iter_view, or
build the view with with_metadata=False.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view
|
str
|
Name of the RecordSet to stream (e.g. "force-curve"). |
required |
source
|
str | Path | None
|
Override the manifest URL / path. |
None
|
data_dir
|
str | Path | None
|
Local data directory (default "./data"). Pass |
DEFAULT_DATA_DIR
|
dataset
|
A pre-loaded |
None
|
|
sim_ids
|
list[int] | None
|
Explicit allowlist of experiment ids (name kept for drop-in
DDACS compatibility). Requested ids that cannot be served warn via
|
None
|
where
|
Callable[[Series], bool] | None
|
Predicate applied to each |
None
|
shuffle
|
bool
|
Per-shard seeded shuffle; call |
False
|
seed
|
int
|
Base seed for the per-shard shuffle. |
0
|