class documentation

class PriorParamSet:

Constructor: PriorParamSet(*prior_params)

View In Hierarchy

A collection of PriorParam instances, used to define the fitting region for a fitting function.

Static Method get_arg_names_of_callable Returns the argument names of the passed callable, if the callable has a "arg_names" attribute, returns that otherwise uses the inspect module.
Method __getitem__ Retrieves a parameter by name or index
Method __init__ Undocumented
Method __len__ Undocumented
Method __repr__ Undocumented
Method append Adds a PriorParam to the set
Method apply_to_callable Given some callable acallable, that accepts arg_names. Call it with the values for those arguments provided in variable_param_values, const_param_values, defaults, not_found_value. Where that list is in order of preference (e...
Method get_linear_transform_to_domain Gets a linear transform from some input domain to some output domain for a set of parameter names
Method wrap_callable_for_scipy_parameter_order Put in a callable with some arguments callable(arg1, arg2, arg3,...), returns a callable that packs all variable params as the first argument, and all const params as the other arguments.
Method wrap_callable_for_ultranest_parameter_order Put in a callable with some arguments callable(arg1, arg2, arg3,...), returns a callable that packs all params as the first argument.
Instance Variable all_param_index_to_constant_param_index_map Undocumented
Instance Variable all_param_index_to_variable_param_index_map Undocumented
Instance Variable param_name_index_map Undocumented
Instance Variable prior_params Undocumented
Property all_params The names of all paramters
Property constant_params The names of the constant parameters
Property consts Returns a dictionary of the constant parameter names and values
Property variable_params The names of the variable parameters
@staticmethod
def get_arg_names_of_callable(acallable: Callable, arg_names: list[str, ...] | None = None):

Returns the argument names of the passed callable, if the callable has a "arg_names" attribute, returns that otherwise uses the inspect module.

# ARGUMENTS #
acallable : Callable
Some callable to get the argument names of
arg_names : None | list[str,...]
If not None, returns this instead of doing any work. Useful if you know exactly what the argument names of the callable are.
def __getitem__(self, k: str | int):

Retrieves a parameter by name or index

def __init__(self, *prior_params):

Undocumented

def __len__(self):

Undocumented

def __repr__(self):

Undocumented

def append(self, p: PriorParam):

Adds a PriorParam to the set

def apply_to_callable(self, acallable: Callable[P, Any], variable_param_values: dict[str, Any], const_param_values: dict[str, Any], defaults: dict[str, Any] = {}, not_found_value: Any = None, arg_names: list[str, ...] | None = None):

Given some callable acallable, that accepts arg_names. Call it with the values for those arguments provided in variable_param_values, const_param_values, defaults, not_found_value. Where that list is in order of preference (e.g., an argument in both const_param_values and defaults will have the value specified in const_param_values.

If arg_names is None, will try and infer the argument names of acallable via self.get_arg_names_of_callable().

def get_linear_transform_to_domain(self, param_names: tuple[str] | list[str], in_domain: tuple[float, float] | list[float, float] | np.ndarray[[2, N], float]):

Gets a linear transform from some input domain to some output domain for a set of parameter names

def wrap_callable_for_scipy_parameter_order(self, acallable, *, arg_to_param_name_map: dict[str, str] = {}, constant_params_as_defaults=True, arg_names: list[str, ...] | None = None):

Put in a callable with some arguments callable(arg1, arg2, arg3,...), returns a callable that packs all variable params as the first argument, and all const params as the other arguments.

i.e., accepts callable:

callable(arg1, arg2, arg3, arg4, ...)
returns callable:
callable((arg1,arg3,...), arg2, arg4, ...)
# RETURNS #
new_callable
A wrapper that accepts all variable parameters as the first argument, and all constant parameters as the other arguments
var_params
A list of the variable parameters in the first argument of new_callable, in the order they are present in the first argument
const_params
A list of the constant parameters that make up the rest of the arguments to new_callable, in the order they are present in the argument list.
def wrap_callable_for_ultranest_parameter_order(self, acallable, arg_to_param_name_map: dict[str, str] = {}):

Put in a callable with some arguments callable(arg1, arg2, arg3,...), returns a callable that packs all params as the first argument.

i.e., accepts callable:

callable(arg1, arg2, arg3, arg4, ...)
returns callable:
`callable(
(arg1,arg3, arg2, arg4, ...)

)`

# RETURNS #
new_callable
Wrapper that accepts arguments as a single tuple
param_names
Parameters names in the order they go into new_callable
all_param_index_to_constant_param_index_map =

Undocumented

all_param_index_to_variable_param_index_map =

Undocumented

param_name_index_map =

Undocumented

prior_params =

Undocumented

@property
all_params =

The names of all paramters

@property
constant_params =

The names of the constant parameters

@property
consts =

Returns a dictionary of the constant parameter names and values

@property
variable_params =

The names of the variable parameters