postgkyl.GData.load

GData.load(file_name, *, tag=None, label=None, ctx=None, value_form=None, basis_type=None, poly_order=None, **read_kwargs)

Load one file into this dataset in place and return self.

This is the two-step counterpart of constructing GData(file_name):

data = GData()
data.load(file_name).local_poly().plot()

The read is atomic with respect to this object: if it fails, the current grid, values, context, and filename are left unchanged. A pristine empty dataset’s existing ctx seeds the read unless ctx is supplied explicitly; reloading an already populated dataset starts from a fresh context so metadata from the previous file cannot leak into the new one. The dataset’s existing tag and custom label are preserved unless tag or label is passed.

This method accepts one literal filename. Use postgkyl.load() for shell-style glob patterns, which produce a GDataGroup rather than one dataset.