mesh_zarr#
Zarr writer sink for PhysicsNeMo Mesh objects.
Writes physicsnemo.mesh.Mesh objects to Zarr stores, producing
output compatible with deep learning workflows. Each mesh is written
to a separate .zarr directory containing:
mesh_pos— positions across all timesteps(T, N, 3)edges— edge connectivity(E, 2)thickness— per-node thickness(N,)Additional point/cell data fields
The sink reconstructs mesh_pos from displacement fields
(displacement_t{idx:03d}) and the reference points tensor.
Classes#
Write |
Module Contents#
- class physicsnemo_curator.domains.mesh.sinks.mesh_zarr.MeshZarrSink(
- output_dir: str,
- compression_level: int = 3,
- chunk_size_mb: float = 1.0,
- naming_template: str | None = None,
Bases:
physicsnemo_curator.core.base.Sink[physicsnemo.mesh.Mesh]Write
Meshobjects to Zarr stores.Each mesh is written to a separate
.zarrdirectory. The sink reconstructs position trajectories from displacement fields and stores them asmesh_pos. Edge connectivity is read fromglobal_data["edges"](computed byEdgeComputeFilter).- Parameters:
output_dir (str) – Directory where Zarr stores will be written.
compression_level (int) – Blosc/zstd compression level (0-9). Default is 3.
chunk_size_mb (float) – Target chunk size in megabytes. Default is 1.0.
naming_template (str | None) – Format string for output names. Placeholders:
{index},{seq}. Default:mesh_{index:04d}.
Examples
>>> sink = MeshZarrSink(output_dir="./output/") >>> paths = sink(mesh_generator, index=0) >>> paths ['./output/mesh_0000.zarr']
Initialize the Zarr sink.
- Parameters:
- classmethod params() list[physicsnemo_curator.core.base.Param]#
Return parameter descriptors for the Zarr sink.
- set_source(
- source: physicsnemo_curator.core.base.Source[physicsnemo.mesh.Mesh],
Set the source for resolving naming placeholders.
- Parameters:
source (Source[Mesh]) – The pipeline source.
- description: ClassVar[str] = 'Write Mesh objects to Zarr stores with configurable compression'#
Short description shown in the interactive CLI.
- property output_dir: pathlib.Path#
Return the output directory path.