Collection of lnPi objects (lnpiseries)#
Classes:
|
Wrapper around |
- class lnpy.lnpiseries.lnPiCollection(data, *, index=None, name=None, dtype=None, xarray_output=True, concat_dim='sample', concat_coords='different', unstack=True, base_class='first')[source]#
Bases:
AccessorMixin,MyAttrsMixinWrapper around
pandas.Seriesfor collection oflnPiMaskedobjects.- Parameters:
data (sequence, mapping,
lnPiCollection, orSeries) – \(\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 byGrandCanonicalEnsemble.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
Note
Underlying data is created from
pd.Series(data, index=index, dtype=dtype, name=name)Attributes:
Underlying series.
Alias to
series()Series values
Alias to
valuesSeries index
Series name
Indexer by value.
Index by position.
Query data.
Positional indexer for everything but phase.
Index with pandas index
state_kws from first
lnPiMaskedNumber of unique lnzs
Values (from
xarray.DataArray) for each sample.Accessor to
GrandCanonicalEnsemble.Accessor to
wFreeEnergyPhasesfromwfe_phases.Accessor to
wFreeEnergyCollectionfromwfe.Deprecated accessor to
wFreeEnergyCollectionfromwlnPi.Deprecated accessor to
wFreeEnergyPhasesfromwlnPi_single.Accessor to
SpinodalsAccessor to
BinodalsMethods:
apply_series_function(func)Apply function to series and wrap.
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, *args[, 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[, ...])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
- property series#
Underlying 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)[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, *args, concat_kws=None, **kwargs)[source]#
Create collection from sequence of objects
- loc[source]#
Indexer by value. See
pandas.Series.loc
- iloc[source]#
Index by position. See
pandas.Series.iloc
- query[source]#
Query data. See
pandas.DataFrame.query()
- 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
**kwargs – Extra keyword arguments to cls
- Returns:
- classmethod from_builder(lnzs, build_phases, build_kws=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.build_phases (
callable()) – Typically one of PhaseCreator.build_phases_mu or PhaseCreator.build_phases_dmubuild_kws (optional) – optional arguments to build_phases
**kwargs – Extra arguments to
from_list()
- 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
GrandCanonicalEnsemble.
- 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