DimensionFractionalIndexer

class PlasmaCalcs.dimensions.dimension_tools.dimension_value.DimensionFractionalIndexer(indexer, *args__None, **kw__None)

Bases: DimensionSpecialValueSpecifier

DimensionSpecialValueSpecifier which specifies to do interprets_fractional_indexing.

Example:

indexer = DimensionFractionalIndexer(0.5)
snaps.get(indexer) –> gets the value at 0.5*len(snaps).
DimensionFractionalIndexer([0.2, 0.3]) # values at 0.2*len(dlist) and 0.3*len(dlist).
DimensionFractionalIndexer(slice(0, None, 0.1)) # values at 0%, 10%, 20%, …, of len(dlist).

Methods

getter(dlist)

get the value(s) from dlist specified by self.indexer, with interprets_fractional_indexing.

_getter_as_str()

return str representation of self.indexer.

_getter_from_str(dlist)

get the value from dlist specified by str self.getter.

_iseler_as_str()

returns str representation of self.iseler.

_iseler_from_str(dvals)

get the indexes from dlist specified by str self.iseler.

_iseler_when_none(dvals)

crash, because self was passed to xarray_isel or xarray_sel but self.iseler is None.

_repr_contents()

contents for repr; used by __repr__.

_getter_as_str()

return str representation of self.indexer.

_getter_from_str(dlist)

get the value from dlist specified by str self.getter.

_iseler_as_str()

returns str representation of self.iseler.

Use self.init_iseler if it exists, else self.iseler if it exists, else ‘UNKNOWN_ISELER’.
_iseler_from_str(dvals)

get the indexes from dlist specified by str self.iseler.

_iseler_when_none(dvals)

crash, because self was passed to xarray_isel or xarray_sel but self.iseler is None.

_repr_contents()

contents for repr; used by __repr__.

getter(dlist)

get the value(s) from dlist specified by self.indexer, with interprets_fractional_indexing.