Croissant¶
rddac.load and rddac.add_view are the two entry points to the Croissant manifest. Both are re-exported at the top level (rddac.load, rddac.add_view); the implementation lives in rddac.croissant.
rddac.load¶
load(source: str | Path | None = None, data_dir: str | Path | None = DEFAULT_DATA_DIR) -> mlc.Dataset
¶
Return an :class:mlcroissant.Dataset for the RDDAC manifest.
Local-first, URL-fallback resolution — see :func:resolve_source. When
data_dir points at a directory that contains files referenced by the
manifest (e.g. zips written by rddac download), mlcroissant is told
to use those local copies instead of refetching from DaRUS.
Pass data_dir=None to opt out of local-file discovery and force
mlcroissant to download via its own cache.
Source code in rddac/croissant.py
rddac.add_view¶
add_view(ds: mlc.Dataset, name: str, fields: dict[str, FieldSpec]) -> mlc.Dataset
¶
Add a custom RecordSet to a loaded dataset and rewire it in place.
Each fields entry references a manifest field by name. Bare ids
resolve to field-map (the h5 source); qualified ids of the form
"<record-set>/<field>" can pull from any other RecordSet, e.g.
"process-parameters/sheet_metal_thickness":
"name": "field_id"— whole field-map field"name": ("field_id", None | int | list[int])— explicit, with optional timestep slicing"name": "process-parameters/<column>"— CSV column from the index
Timestep slicing is only valid on field-map sources. The published
manifest on DaRUS is untouched — only the in-memory representation
grows. ds is mutated in place and returned for optional chaining.
Source code in ddacs/croissant.py
Module reference¶
Croissant manifest access for RDDAC — thin wrappers over :mod:ddacs.croissant.
The machinery lives in the ddacs package (shared with the DDACS simulation
dataset); everything here just injects :data:rddac.spec.RDDAC_SPEC so the
manifest resolution targets the RDDAC dataset. The manifest conventions
(field-map RecordSet, process-parameters join on index) are
identical between the datasets, so add_view & friends pass through as-is.
metadata_url()
¶
Return the DaRUS download URL for the published RDDAC metadata.json.
Resolved via the DaRUS API (numeric file id — DaRUS has no per-file persistent ids) and cached for the process lifetime.
Source code in rddac/croissant.py
resolve_source(source=None, data_dir=None)
¶
Return the source string (path or URL) that :func:load would use.
Resolution order
sourceif given (local path or HTTP(S) URL).<data_dir>/metadata.jsonif it exists locally.- The DaRUS download URL from :func:
metadata_url.
Source code in rddac/croissant.py
field_map(dataset)
¶
Map each HDF5 field name in the field-map RecordSet to its mlc Field.
process_parameters_descriptions(dataset)
¶
Map each process_parameters column to its human-readable description.
Pulled directly from the process-parameters RecordSet in the manifest.
Source code in ddacs/croissant.py
rddac.croissant.METADATA_URL mirrors the DDACS constant of the same name, but is a lazy module attribute: DaRUS assigns no per-file persistent ids, so the numeric file id behind the download URL is resolved through the DaRUS API on first access (see metadata_url above) and cached for the process lifetime.