postgkyl.save

postgkyl.save(data, out_name='', extension='gkyl', var_name='CartGridField')

Write data to out_name in the requested extension.

The gkyl format preserves all dataset metadata, including value_form, num_quad, and simulation identity. Structural fields are stored in the binary header; the private load-history snapshot is omitted. Current metadata takes precedence over the output filename when reloading. Its field header supports uniform Cartesian cell edges only: nonuniform, mapped, and point-coordinate grids are rejected before the output is opened, since the format cannot preserve those coordinates.

Parameters:
  • data – a dataset exposing num_dims/num_comps/num_cells/ bounds/values/grid/ctx (a GDataState or subclass).

  • out_name – output path; when empty a name is derived from the source file.

  • extension – one of "gkyl" (default), "txt", "npy", "vtk".

  • var_name – unused placeholder kept for interface symmetry.

Returns:

The path actually written.

CLI: save