Collection of lnPi objects (lnpiseries)#
Classes:
|
Wrapper around |
- class lnpy.lnpiseries.lnPiCollection(data, index=None, xarray_output=True, concat_dim=None, concat_coords=None, unstack=True, name=None, base_class='first', dtype=None)[source]#
Bases:
AccessorMixinWrapper around
pandas.Seriesfor collection oflnPiMaskedobjects.- Parameters:
data (sequence of
lnPiMasked) – \(\ln \Pi(N)\) instances to consider.index (array-like,
pandas.Index,pandas.MultiIndex, optional) – Index to apply to Series.xarray_output (
bool, defaultTrue) – If True, then wrap lnPiCollection outputs inDataArrayconcat_dim (
str, optional) – Name of dimensions to concat results along. Also Used byxGrandCanonical.concat_coords (
string, optional) – parameters coords `to :func:`xarray.concatunstack (
bool, defaultTrue) – If True, then outputs will be unstacked usingxarray.DataArray.unstack()single_state (
bool, defaultTrue) – If True, verify that all data has same shape, and value of state_kws. That is, alllnpiare for a single state.*args **kwargs – Extra arguments to Series constructor
Methods:
new_like([data, index])Create new object with optional new data/index
xs(key[, axis, level, drop_level, wrap])Interface to
pandas.Series.xs()append(to_append[, ignore_index, ...])Interface to
pandas.concat()droplevel(level)New object with dropped level
apply(func[, convert_dtype, args, wrap])Interface to
pandas.Series.apply()sort_index(*args, **kwargs)Interface to
pandas.Series.sort_index()groupby([by, level, as_index, sort, ...])Wrapper around
pandas.Series.groupby().groupby_allbut(drop, *[, wrap])Groupby all but columns in drop
concat_like(objs, **concat_kws)Concat a sequence of objects like self
concat(objs[, concat_kws])Create collection from sequence of objects
get_index_level([level])Get index values for specified level
wrap_list_results(items)Utility to wrap output in :class:xarray.DataArray
from_list(items, index, **kwargs)Create collection from list of
lnPiMaskedobjects.from_builder(lnzs, build_phases[, ref, ...])Build collection from scalar builder
to_dataarray([dtype, reset_index])Convert collection to a
DataArrayfrom_labels(ref, labels, lnzs[, features, ...])Create from reference
lnPiMaskedand labels arrayfrom_dataarray(ref, da[, grouper, ...])Create a collection from DataArray of labels
Attributes:
View of the underlying
pandas.SeriesAlias to
series()Series values
Alias to
valuesSeries index
Series name
state_kws from first
lnPiMaskedNumber of unique lnzs
Values (from
xarray.DataArray) for each sample.Accessor to
xGrandCanonical.Accessor to
wFreeEnergyPhasesfromwfe_phases.Accessor to
wFreeEnergyCollectionfromwfe.Deprecated accessor to
wFreeEnergyCollectionfromwlnPi.Deprecated accessor to
wFreeEnergyPhasesfromwlnPi_single.Accessor to
SpinodalsAccessor to
Binodals- property series#
View of the underlying
pandas.Series
- property values#
Series values
- property index#
Series index
- property name#
Series name
- xs(key, axis=0, level=None, drop_level=False, wrap=True)[source]#
Interface to
pandas.Series.xs()
- append(to_append, ignore_index=False, verify_integrity=True, concat_kws=None, inplace=False)[source]#
Interface to
pandas.concat()- Parameters:
See also
- apply(func, convert_dtype=True, args=(), wrap=False, **kwds)[source]#
Interface to
pandas.Series.apply()
- sort_index(*args, **kwargs)[source]#
Interface to
pandas.Series.sort_index()
- groupby(by=None, *, level=None, as_index=True, sort=True, group_keys=True, observed=False, dropna=True, wrap=False)[source]#
Wrapper around
pandas.Series.groupby().See also
- classmethod concat(objs, concat_kws=None, *args, **kwargs)[source]#
Create collection from sequence of objects
- property state_kws#
state_kws from first
lnPiMasked
- property nlnz#
Number of unique lnzs
- index_frame[source]#
Values (from
xarray.DataArray) for each sample.includes a column ‘lnz_index’ which is the unique lnz values regardless of phase
- classmethod from_list(items, index, **kwargs)[source]#
Create collection from list of
lnPiMaskedobjects.- Parameters:
items (sequence of
lnPiMasked) – Sequence of lnPiindex (sequence) – Sequence of phases ID for each lnPi
*args – Extra positional arguments to cls
**kwargs – Extra keyword arguments to cls
- Returns:
- classmethod from_builder(lnzs, build_phases, ref=None, build_kws=None, nmax=None, base_class='first', **kwargs)[source]#
Build collection from scalar builder
- Parameters:
lnzs (sequence of
float) – One dimensional array of lnz value for the varying component.ref (
lnPiMasked) – lnpi_phases to reweight to get list of lnpi’sbuild_phases (
callable()) – Typically one of PhaseCreator.build_phases_mu or PhaseCreator.build_phases_dmubuild_kws (optional) – optional arguments to build_phases
- Returns:
See also
- classmethod from_labels(ref, labels, lnzs, features=None, include_boundary=False, labels_kws=None, check_features=True, **kwargs)[source]#
Create from reference
lnPiMaskedand labels array- Parameters:
ref (
lnPiMasked)labels (sequence of
ndarrayofint) – Eachlabels[i]is a labels array for each value oflnzs[i]. That is, the labels for different phases at a given value of lnz.lnzs (sequence) – Each lnzs[i] will be passed to
ref.reweight.features (sequence of
int) – If specified, extract only those locations wherelabels == featurefor all valuesfeature in features. That is, select a subset of unique label values.include_boundary (
bool) – if True, include boundary regions in output masklabels_kws (mapping, optional)
check_features (
bool) – if True, then make sure each feature is in labels**kwargs – Extra arguments past to
from_list()
See also
- classmethod from_dataarray(ref, da, grouper='sample', include_boundary=False, labels_kws=None, features=None, check_features=True, **kwargs)[source]#
Create a collection from DataArray of labels
- Parameters:
ref (
lnPiMasked)grouper (
Hashable) – Name of dimension(s) to group along to give a single label arrayfeatures (sequence of
int) – If specified, extract only those locations wherelabels == featurefor all valuesfeature in features. That is, select a subset of unique label values.check_features (
bool) – if True, then make sure each feature is in labels
See also
- xge[source]#
Accessor to
xGrandCanonical.
- wfe[source]#
Accessor to
wFreeEnergyPhasesfromwfe_phases.
- wfe_phases[source]#
Accessor to
wFreeEnergyCollectionfromwfe.
- property wlnPi#
Deprecated accessor to
wFreeEnergyCollectionfromwlnPi.Alias to
wfe
- property wlnPi_single#
Deprecated accessor to
wFreeEnergyPhasesfromwlnPi_single.Alias to
wfe_phases