hydromodpy.results.zarr_store.zarr_writer#

Write-side concerns for SimulationZarr.

Owns every write_* entry point: mesh, time, CRS, fields, forcing timeseries and raster, geographic rasters, and ACDD root attrs. Also owns the chunk / sharding decisions and the CF attribute composition that flows from the registry.

Helpers take the live SimulationZarr so the module stays free of hidden state and can be unit-tested in isolation.

Functions

attach_field_attrs(target, variable)

Stamp the registry-derived CF attrs onto an existing field array.

attrs_for_field(name, dtype)

Compose CF attrs for a field straight from the registry + _FillValue.

ensure_child_dir(store_obj, target, name)

Pre-create a directory node under target for the live store.

field_name_from_target(target, variable)

Return the canonical registry field name for (group, variable).

maybe_shards(ndim, n_timesteps, chunk_shape, ...)

Pick a shard shape when the total array size crosses the 100 MiB trigger.

write_acdd_root_attrs(store_obj, *, sim_row, ...)

Compose and persist ACDD root attrs.

write_crs(store_obj, *, crs_wkt[, ...])

Persist the CF grid-mapping CRS variable.

write_field(store_obj, variable, timestep, ...)

Append one timestep slice to variable under subgroup or root.

write_forcing_field(store_obj, variable, data, *)

Persist a gridded forcing field under forcing/<var>.

write_forcing_timeseries(store_obj, ...[, ...])

Persist a per-station forcing timeseries under forcing/<var>/<station>.

write_geographic_raster(store_obj, name, ...)

Persist a per-run raster under geographic/<name>.

write_mesh(store_obj, vertices, ...[, ...])

Write the UGRID-1.0 mesh group, including the optional topography array.

write_time(store_obj, values, *[, epoch, ...])

Persist the CF time coordinate.

write_topography(store_obj, topography, *[, ...])

Write the mesh topography (and optional z_interfaces) only.