pyrokinetics.gk_code.gk_output.GKOutputArgs#
- class pyrokinetics.gk_code.gk_output.GKOutputArgs[source]#
Bases:
objectUtility base dataclass used to pass quantities to
GKOutput. Derived classes includeCoords,Fields,Fluxes, etc. This class contains features such as automatic unit conversion and a dict-like interface to quantities.Derived classes should define an
InitVar[Tuple[str, ...]]calleddims, which sets the dimensionality of each quantity, e.g.("kx", "ky", "time"). This should be set in__post_init__, along with a call to_set_and_check_dims. This is to work around the pre-Python 3.10 dataclass issues regarding keyword arguments in base classes- __init__()#
- Return type:
None
Methods
__init__()items()Dict-like items iteration
units(name, c)Return the units for each quantity
values()Dict-like values iteration
with_units(c)Apply units to each quantity in turn and return a new
Coords.Attributes
Tuple containing the names of each supplied field (those that aren't
None).Names of all quantities held by this dataclass
Shape of quantities.
- property coords: Tuple[str, ...]#
Tuple containing the names of each supplied field (those that aren’t
None).
- property shape: Tuple[int, ...]#
Shape of quantities. Raises error if all are None. Should be overridden in
Coords, where this function makes no sense.
- abstract units(name, c)[source]#
Return the units for each quantity
- Return type:
- Parameters:
name (str)