Instances of ParameterSubspace represent subspaces of the global parameter space associated with a model.

class xpsi.ParameterSubspace.ParameterSubspace(*args, **kwargs)[source]

Ordered parameter subspace.

  • prefix (str) – In common modelling patterns there are multiple instances of a particular subspace, so provide a unique naming prefix. The prefix will be suffixed with a double-underscore. Note that this prefix will prepend prefixes for encapsulated parameters lower in the hierarchy which themselves have identification prefixes.
  • args – Instances of Parameter, or iterables over instances of Parameter or ParameterSubspace. All parameters and subspaces will be merged into this new subspace.

Useful callable way to update parameters with a simple vector.

The order must match the order in which parameters were merged into the subspace. Note that this method is often overwritten in subclasses, but this parent method can always be accessed if required.

Parameters:p (array-like) – New point to update to. If None, the current point is returned. The object must be ordered to match that of container self.
Returns:Current point (if the call was not an update).
Return type:array-like

Pass a string or an integer (latter only for free parameters).


Get an iterator over free parameters.


Redirect for Python 3 compatibility.


Redirect to the string representation.

__setitem__(key, value)[source]

Pass a string or an integer (latter only for free parameters).


Get a summary of the parameters constituting the subspace.


Check for duplicates and grow in dimensionality if not.

classmethod _update_doc()[source]

Append the docstring with parameter names in class attributes.


Get the cached values of all free parameters in the subspace.


Clear the cache for all free parameters in the subspace.


That this also deletes the current parameter values, in addition to the cached previous values.


Get a reference to a parameter object by name.


Get the index of a free parameter.


Merge parameters into the subspace, thereby expanding it.


Get a list of parameter names.


Do cached dependencies need to be updated?


Get next free parameter.


Get the list of parameter objects.


Get the unique prefix for subspace identification.


Get all variable values (free parameters and fixed/derived).