Migrating existing workflows¶
The refactored API resolves the basis and stored representation when loading, then composes operations on that dataset. The following inventory describes current support; an unsupported legacy feature is not an implicit conversion.
Compatibility inventory¶
Previous workflow |
Current status |
Supported replacement or limit |
|---|---|---|
Native Gkeyll |
Supported, including partial loading and dynvectors. |
Supply missing or incorrect basis metadata once to |
Legacy Gkeyll HDF5 and FLASH HDF5 |
Readers remain available. |
Header/layout detection chooses the reader; inspect |
ADIOS |
Removed from this implementation; no ADIOS reader or writer is registered. |
Use a compatible legacy tool to export evaluated arrays and coordinates, if that tool supports the file, or regenerate supported Gkeyll output. This release does not convert ADIOS files. |
|
Not implemented by the current native basis bridge. |
Evaluate with a compatible legacy implementation or regenerate output. Changing the basis name alone does not convert coefficients. |
|
Not implemented by the current native basis bridge. |
Preserve the original basis meaning; do not relabel it |
Historical basis abbreviations |
Load uses full basis names and a separate |
|
Per-command |
Basis/order/representation belong to |
Use |
Separate interpolator objects and tuple results |
|
Access |
|
Replaced by the single representation operation. |
Use |
CLI aliases and abbreviated commands |
Explicit aliases are |
Unique command prefixes are accepted; ambiguous prefixes raise. Use canonical command names in maintained scripts. |
Generic CLI |
Not provided by the generated executor; transforms use the working set. |
Use separate CLI invocations or filter a Python |
|
Replaced by |
Formats: |
Loading legacy metadata¶
Move the old command-local basis override to the load boundary:
# Previous command vocabulary:
pgkyl legacy.gkyl interpolate --basis_type ms --poly_order 1 plot
# Current command vocabulary:
pgkyl load --file_name legacy.gkyl --basis_type serendipity \
--poly_order 1 --value_form modal interpolate plot --no_show
The Python equivalent is:
import postgkyl as pg
data = pg.load("legacy.gkyl", basis_type="serendipity",
poly_order=1, value_form="modal")
evaluated = data.interpolate()
grid, values = evaluated.grid, evaluated.values
quadrature = data.represent(to="quad")
recovered = quadrature.represent(to="modal")
These options assert the known meaning of existing coefficients. They do not
repair unsupported basis layouts or translate an unrelated file format. Hybrid
phase-space files must resolve their configuration/velocity split; explicit
Python metadata can be supplied as ctx={"num_cdim": 1, "num_vdim": 2} for
a known 1x2v Vlasov hybrid file. Missing or ambiguous information is not a basis
conversion. Interpolation and representation transforms preserve this split;
native weak/integration kernels that cannot express it raise explicitly. Basis
support for transforms does not imply support for every native operation.
Selecting tagged data¶
Tags label datasets; they do not narrow the generated CLI working set. Filter explicitly in Python when different species or representations need different operations:
group = pg.GDataGroup()
group.load("sim-elc_*.gkyl", tag="electron")
group.load("sim-ion_*.gkyl", tag="ion")
electrons = pg.GDataGroup(d for d in group if d.get_tag() == "electron")
electron_values = electrons.interpolate()
Return values and saving¶
pg.load(literal_path) returns a GData; a glob always returns a
GDataGroup. Most transformations return a dataset, with inplace=True
requesting mutation. Full integrate() returns a scalar for one physical
field or a NumPy array for several; partial modal integration returns a
lower-dimensional modal dataset. plot() returns a figure. save() returns
the written path. Group transformations return groups, and terminal operations
usually return lists of per-member results.
The Gkeyll field header can reconstruct only uniform Cartesian cell edges.
Saving nonuniform, point-coordinate, or mapped geometry as .gkyl raises
before opening the destination. Old mapped files that omitted their coordinates
cannot be repaired from metadata alone; reload the original data and mapping.
Text export retains the physical coordinates of supported point/edge layouts.
.npy exports values only and is not a complete dataset round trip. The
registered loaders do not provide a general .txt or .npy dataset reader.
path = data.save("preserved.gkyl") # supported uniform DG geometry
total = data.integrate() # terminal scalar/array
path = evaluated.save("samples", extension="txt")
Modal multiplication and division remain weak DG operations. Pointwise nonlinear
work uses represent(to="quad") or apply as described in Working with data.
Plotting a physical field likewise requires explicit evaluation; raw modal
plots show labeled coefficient channels.