PlasmaCalcs.dimensions.dimension_tools.dimension_value.DimensionSingleValueSpecifier

class PlasmaCalcs.dimensions.dimension_tools.dimension_value.DimensionSingleValueSpecifier(getter, checker, *args_super, **kw_super)

Bases: DimensionSpecialValueSpecifier

DimensionSpecialValueSpecifier which includes checker, to check if single value matches.
getter gets appropriate single value from list.
checker checks if value is a match for this specifier.
e.g. fluids.py defines ELECTRON,
with getter calling FluidList.get_electron,
and checker calling Fluid.is_electron().
getter: str or callable
self specifies to use the dimension value(s): self.getter(dlist)
callable –> callable of 1 arg; will be passed dlist.
str –> use dlist.{getter}(). E.g. getter=’get_ion’ –> use dlist.get_ion().
internally stored at self.init_getter.
checker: str or callable
when checking value==self (or self==value): use self.checker(value)
callable –> callable of 1 arg; will be passed value.
str –> use value.{checker}(). E.g. checker=’is_electron’ –> use value.is_electron().
internally stored at self.init_checker.
iseler: None, str, or callable
if provided, can use self in calls to PlasmaCalcs’ xarray_isel and xarray_sel,
commonly via array.pc.sel(dim=self) or array.pc.isel(dim=self).
callable –> callable of 1 arg; will be passed list of coord values for dim,
(probably a list of DimensionValue objects, maybe converted to DimensionValueList).
must return index (or indexes) appropriate for xarray.isel.
str –> use dlist.{iseler}(), where dlist=isel_cls(list of coord values for dim).
E.g. iseler=’i_ions’, isel_cls=FluidList –> use FluidList(values).i_ions().
internally stored at self.init_iseler.
isel_cls: None or type
if provided, iseler calls use iseler(isel_cls(list of coord values for dim)),
else, iseler calls use iseler(list of coord values for dim).
__init__(getter, checker, *args_super, **kw_super)

Methods

__init__(getter, checker, *args_super, ...)