noether.data.zarr_store.layout

Mapping between Noether FileMap fields and the per-field Zarr array layout.

Every CFD field is assigned to a domain (surface / volume), a canonical name (f"{domain}_{name}" — matching the dataset’s getitem_* / normalizer keys), a channel width, and a kind:

  • coord — point positions, stored float32;

  • value — physical quantities, stored float16.

Each field becomes its own Zarr array (<domain>/<name>), so fields are read independently; all arrays of a domain share the shuffle permutation and chunk grid.

Attributes

Classes

FieldSpec

Static description of one CFD field.

Functions

present_specs(filemap)

Return the FIELD_SPECS whose filemap_attr is set on filemap.

build_domain_layouts(filemap[, coords_dtype, ...])

Build the per-domain DomainLayout (one array per field) present in filemap.

filename_to_canonical(filemap)

Reverse map stored_filename -> canonical_field for the present fields.

Module Contents

class noether.data.zarr_store.layout.FieldSpec

Static description of one CFD field.

filemap_attr: str

Attribute name on FileMap.

domain: str
name: str

Short name within the domain; combined as f"{domain}_{name}".

dim: int

Channel width (1 for scalars, 3 for vectors).

kind: str

"coord" or "value".

property canonical: str

Canonical field key, e.g. "volume_velocity".

Return type:

str

noether.data.zarr_store.layout.EXCLUDED_FILEMAP_FIELDS: frozenset[str]
noether.data.zarr_store.layout.FIELD_SPECS: list[FieldSpec] = []
noether.data.zarr_store.layout.CANONICAL_TO_SPEC: dict[str, FieldSpec]
noether.data.zarr_store.layout.present_specs(filemap)

Return the FIELD_SPECS whose filemap_attr is set on filemap.

Parameters:

filemap (noether.data.schemas.FileMap)

Return type:

list[FieldSpec]

noether.data.zarr_store.layout.build_domain_layouts(filemap, coords_dtype='float32', values_dtype='float16', field_dtypes=None)

Build the per-domain DomainLayout (one array per field) present in filemap.

Parameters:
  • filemap (noether.data.schemas.FileMap) – Field-to-filename mapping for the dataset being converted.

  • coords_dtype (str) – Dtype string for position arrays.

  • values_dtype (str) – Dtype string for physical field arrays.

  • field_dtypes (dict[str, str] | None) – Per-field dtype overrides keyed by canonical name, e.g. {"volume_vorticity": "float32"} for fields whose dynamic range exceeds values_dtype (float16 caps at ~6.6e4).

Returns:

Mapping domain -> DomainLayout.

Raises:

ValueError – If a domain has no (or more than one) coordinate field.

Return type:

dict[str, noether.data.zarr_store.manifest.DomainLayout]

noether.data.zarr_store.layout.filename_to_canonical(filemap)

Reverse map stored_filename -> canonical_field for the present fields.

Lets a Zarr-backed dataset translate the .pt filename referenced by an AeroDataset.getitem_* method back to the canonical field key used in the Zarr store.

Parameters:

filemap (noether.data.schemas.FileMap)

Return type:

dict[str, str]