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.


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.


Current point (if the call was not an update).

Return type:



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


Get an iterator over free parameters.


Get next free parameter.


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.

classmethod _update_doc()[source]

Append the docstring with parameter names in class attributes.

property cached

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.

property names

Get a list of parameter names.

property needs_update

Do cached dependencies need to be updated?

property params

Get the list of parameter objects.

property prefix

Get the unique prefix for subspace identification.

property vector

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