grid_sidecar#
Structured-grid sidecar sink.
Persists structured-grid tensordict.TensorDict objects (produced by
VTISource) to disk as
tensordict memmap directories. Output is written as a sidecar: by
default the source’s directory layout is mirrored under output_dir using
the {relpath}/{stem} naming, so each grid lands next to the mesh
(.pmsh / .pdmsh) outputs for the same sample.
Reload with tensordict.TensorDict.load_memmap().
Attributes#
Classes#
Write structured-grid TensorDicts as tensordict memmap sidecars. |
Module Contents#
- class physicsnemo_curator.domains.mesh.sinks.grid_sidecar.GridSidecarSink( )#
Bases:
physicsnemo_curator.core.base.Sink[tensordict.TensorDict]Write structured-grid TensorDicts as tensordict memmap sidecars.
Each grid is written to a
<name>.griddirectory under output_dir. When the pipeline source exposesrelative_path(index)(e.g.VTISource), the default{relpath}/{stem}template mirrors the input layout so the grid sits beside the corresponding mesh outputs.- Parameters:
output_dir (str) – Directory where grid sidecars will be written.
naming_template (str or None) – Format string for output names. Placeholders:
{index},{seq},{relpath},{stem}. Default"{relpath}/{stem}"when the source supports it, else"grid_{index:04d}_{seq}".group_readable (bool) – If
True,chmod g+rthe written output.
Examples
>>> pipeline = VTISource("./grids/").write(GridSidecarSink(output_dir="./out/"))
- classmethod params() list[physicsnemo_curator.core.base.Param]#
Return parameter descriptors for the grid sidecar sink.
- set_source(
- source: physicsnemo_curator.core.base.Source[tensordict.TensorDict],
Inject the pipeline source for placeholder resolution.
- Parameters:
source (Source[TensorDict]) – The pipeline source.
relative_path(index)is used when available to resolve{relpath}/{stem}.
- description: ClassVar[str] = 'Write structured-grid TensorDicts as tensordict memmap sidecars'#
Short description shown in the interactive CLI.
- property output_dir: pathlib.Path#
Return the output directory path.
- physicsnemo_curator.domains.mesh.sinks.grid_sidecar.logger#