Croissant¶
ddacs.load and ddacs.add_view are the two entry points to the Croissant manifest. Both are re-exported at the top level (ddacs.load, ddacs.add_view); the implementation lives in ddacs.croissant.
ddacs.load¶
load(source: str | Path | None = None, data_dir: str | Path | None = DEFAULT_DATA_DIR, spec: DatasetSpec = DDACS_SPEC) -> mlc.Dataset
¶
Return an :class:mlcroissant.Dataset for the DDACS 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 ddacs 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 ddacs/croissant.py
ddacs.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 via mlcroissant.
Single source of truth for field/column descriptions, dataset name, etc. — nothing is duplicated in the Python package.
resolve_source(source=None, data_dir=None, spec=DDACS_SPEC)
¶
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 permanent DaRUS URL :data:
METADATA_URL.
Source code in ddacs/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.