Base classes#
- class thermoextrap.core._attrs_utils.MyAttrsMixin[source]#
Bases:
object
Baseclass for adding some sugar to attrs.derived classes.
Methods:
asdict
()Convert object to dictionary.
new_like
(**kws)Create a new object with optional parameters.
assign
(**kws)Alias to
new_like()
.- new_like(**kws)[source]#
Create a new object with optional parameters.
- Parameters:
**kws – attribute, value pairs.
- assign(**kws)[source]#
Alias to
new_like()
.
- class thermoextrap.data.AbstractData(*, meta=None, umom_dim='umom', deriv_dim=None, x_is_u=False)[source]#
Bases:
MyAttrsMixin
Abstract class for data.
Attributes:
Callback
Energy moments dimension
Derivative dimension
Whether the observable x is the same as energy u
Expansion order.
Whether central (True) or raw (False) moments are used.
Sequence of arguments to derivative calculation function.
Whether X has explicit dependence on alpha.
Methods:
asdict
()Convert object to dictionary.
assign
(**kws)Alias to
new_like()
.new_like
(**kws)Create a new object with optional parameters.
- meta#
Callback
- umom_dim#
Energy moments dimension
- deriv_dim#
Derivative dimension
- x_is_u#
Whether the observable x is the same as energy u
- abstract property order#
Expansion order.
- abstract property central#
Whether central (True) or raw (False) moments are used.
- abstract property deriv_args#
Sequence of arguments to derivative calculation function.
- property xalpha#
Whether X has explicit dependence on alpha.
That is, if self.deriv_dim is not None
- assign(**kws)[source]#
Alias to
new_like()
.
- class thermoextrap.data.DataCentralMomentsBase(*, meta=None, umom_dim='umom', deriv_dim=None, xmom_dim='xmom', rec_dim='rec', central=False, x_is_u=None, use_cache=True)[source]#
Bases:
AbstractData
,Generic
[DataT
]Data object based on central co-moments array.
- Parameters:
dxduave (
CentralMomentsData
) – Central moments object.rec_dim (hashable) – Name of dimension for ‘records’, i.e., multiple observations.
umom_dim (
str
, default'umom'
) – Name of dimension for moment of energy u.xmom_dim (
str
, default'xmom'
) – Name of dimension for moments of observable x.deriv_dim (
str
, defaultNone
) – if deriv_dim is a string, then this is the name of the derivative dimension and xarray objects will have a derivativecentral (
bool
) – If True, Use central moments. Otherwise, use raw moments.meta (
dict
, optional) – extra meta data/parameters to be carried along with object and child objects. if ‘checker’ in meta, then perform a callback of the form meta[‘checker](self, meta) this can also be used to override things like deriv_args. Values passed through method resample_metax_is_u (
bool
, defaultFalse
) – if True, treat xv = uv and do adjust u/du accordinglyuse_cache (
bool
) – IfTrue
(default), cache intermediate result. Speeds up calculations, but can lead to large objects.
Attributes:
Overvable moment dimension
Records dimension
Whether central or raw moments are used
Whether observable x is same as energy u
Wrapped
cmomy.CentralMomentsData
object.Order of expansion.
Data underlying
dxduave
.Averages of form
x * u ** n
.Averages of form
u ** n
.Averages of form observable
x
.Averages of form
dx * dx ** n
.Averages of
du ** n
.Indexer for
u_selector[n] = u ** n
.Indexer for
xu_select[n] = x * u ** n
.Selector for
xave
.Selector for
du_selector[n] = du ** n
.Selector for
dxdu_selector[n] = dx * du ** n
.Arguments to be passed to derivative function.
Derivative dimension
Callback
Energy moments dimension
Whether X has explicit dependence on alpha.
Methods:
rmom
()Raw co-moments.
cmom
()Central co-moments.
asdict
()Convert object to dictionary.
assign
(**kws)Alias to
new_like()
.new_like
(**kws)Create a new object with optional parameters.
- xmom_dim#
Overvable moment dimension
- rec_dim#
Records dimension
- central#
Whether central or raw moments are used
- x_is_u#
Whether observable x is same as energy u
- property dxduave#
Wrapped
cmomy.CentralMomentsData
object.
- property order#
Order of expansion.
- property deriv_args#
Arguments to be passed to derivative function.
For example,
derivs(*self.deriv_args)
.
- assign(**kws)[source]#
Alias to
new_like()
.
- deriv_dim#
Derivative dimension
- meta#
Callback
- new_like(**kws)[source]#
Create a new object with optional parameters.
- Parameters:
**kws – attribute, value pairs.
- umom_dim#
Energy moments dimension
- property xalpha#
Whether X has explicit dependence on alpha.
That is, if self.deriv_dim is not None