lib.samples.plotting.ParameterPlotStyle¶
- class lib.samples.plotting.ParameterPlotStyle(style=None, **kwargs)¶
Bases:
cosmopipe.lib.plotting.BasePlotStyleBase plotting class for parameter values.
Methods
Return shallow copy of
self.deepcopyInstantiate and initalize class with state dictionary.
Return
valueif notNone, else attributenameif notNone, elsedefault.Return color corresponding to label
label.Return default truth / reference values for parameters.
Same as
get(), but ensuring returned value is a list.Return parameters.
is_mpi_broadcastis_mpi_gatheredis_mpi_rootis_mpi_scatteredLoad class in numpy binary format from disk.
If different formats are possible, this method should between them based on file name extension.
log_criticallog_debuglog_errorlog_infolog_warningSave class to disk.
If different formats are possible, this method should between them based on file name extension.
Save figure to
filename.Update attibutes with those in
kwargs.Attributes
loggerMPI attributes
mpicommmpirootmpistate- copy()¶
Return shallow copy of
self.
- classmethod from_state(state, mpiroot=0, mpicomm=None)¶
Instantiate and initalize class with state dictionary.
- get(name, value=None, default=None)¶
Return
valueif notNone, else attributenameif notNone, elsedefault.- Parameters
name (string) – Attribute name. If
None, defaults todefault.value (object, default=None) – Value. If
None, returns attributename.default (object, default=None) – Default value.
- get_color(label, labels=None)¶
Return color corresponding to label
label. Ifcolorsis a list, return color at index oflabelin list of labelslabels.
- get_default_truths(parameters, truths=None)¶
Return default truth / reference values for parameters.
- Parameters
parameters (Parameter, tuple, list, ParameterCollection) – Parameters to return truth values for.
truths (list, default=None) – List of truth values. If
None, returntruthsif exists, else set all truths toNone. If'value', return list ofParameter.value.
- Returns
truths – Return single value if
parametersis a single parameter.- Return type
float, list
- get_list(name, value=None, default=None)¶
Same as
get(), but ensuring returned value is a list. Default length (seemake_list()) is taken asdefaultlength.
- static get_parameters(parameters, chains=None)¶
Return parameters.
- Parameters
parameters (tuple, list, ParameterCollection) – List of parameter (names). If parameter name, get the xorresponding parameter in the first element in
chainsthat contains this parameter.chains (list) – List of classes with
parametersattribute.
- Returns
toret – Return single parameter if
parametersis a single parameter (name).- Return type
- classmethod load(filename, mpiroot=0, mpicomm=None)¶
Load class in numpy binary format from disk. If the loaded state contains
__class__and that exists incls._registry, return instance ofcls._registry[__class__](instead ofcls).
- load_auto(*args, **kwargs)¶
If different formats are possible, this method should between them based on file name extension.
- property mpiattrs¶
MPI attributes
- save(filename)¶
Save class to disk.
- save_auto(*args, **kwargs)¶
If different formats are possible, this method should between them based on file name extension.
- savefig(filename, fig=None)¶
Save figure to
filename.- Parameters
filename (string) – Path where to save figure.
fig (matplotlib.figure.Figure, default=None) – Figure to save. Defaults to current figure.
- update(**kwargs)¶
Update attibutes with those in
kwargs.