parameter - Optimization parameter definition

Alias Parameter alias.
BaseParameter Root of the parameter class, defining arithmetic on parameters
Constant An unmodifiable value.
Constraint Abstract base class for constraints.
ConstraintEQ Constraint operator ==
ConstraintGE Constraint operator >=
ConstraintGT Constraint operator >
ConstraintLE Constraint operator <=
ConstraintLT Constraint operator <
ConstraintNE Constraint operator !=
FreeVariables A collection of parameter sets for a group of models.
Function Delayed function evaluator.
IntegerParameter
OperatorAdd Parameter operator +
OperatorDiv Parameter operator /
OperatorMul Parameter operator *
OperatorPow Parameter operator **
OperatorSub Parameter operator -
Parameter A parameter is a symbolic value.
ParameterSet A parameter that depends on the model.
Reference Create an adaptor so that a model attribute can be treated as if it were a parameter.
acosd Return the arc cosine (measured in in degrees) of x.
arccosd Return the arc cosine (measured in in degrees) of x.
arcsind Return the arc sine (measured in in degrees) of x.
arctan2 atan2(y, x)
arctan2d Return the arc tangent (measured in in degrees) of y/x.
arctand Return the arc tangent (measured in in degrees) of x.
asind Return the arc sine (measured in in degrees) of x.
atan2d Return the arc tangent (measured in in degrees) of y/x.
atand Return the arc tangent (measured in in degrees) of x.
boxed_function
cosd Return the cosine of x (measured in in degrees).
current
fittable Return the list of fittable parameters in no paraticular order.
flatten
format Format parameter set for printing.
function Convert a function into a delayed evaluator.
randomize Set random values to the parameters in the parameter set, with values chosen according to the bounds.
sind Return the sine of x (measured in in degrees).
substitute Return structure a with values substituted for all parameters.
summarize Return a stylized list of parameter names and values with range bars suitable for printing.
tand Return the tangent of x (measured in in degrees).
unique Return the unique set of parameters
varying Return the list of fitted parameters in the model.

Fitting parameter objects.

Parameters are a big part of the interface between the model and the fitting engine. By saving and retrieving values and ranges from the parameter, the fitting engine does not need to be aware of the structure of the model.

Users can also perform calculations with parameters, tying together different parts of the model, or different models.

class bumps.parameter.Alias(obj, attr, p=None, name=None)[source]

Bases: object

Parameter alias.

Rather than modifying a model to contain a parameter slot, allow the parameter to exist outside the model. The resulting parameter will have the full parameter semantics, including the ability to replace a fixed value with a parameter expression.

# TODO: how is this any different from Reference above?

parameters()[source]
update()[source]
class bumps.parameter.BaseParameter[source]

Bases: object

Root of the parameter class, defining arithmetic on parameters

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)[source]

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = False
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

fittable = False
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()[source]

Format the parameter, value and range as a string.

log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()[source]

Return -log(P) for the current parameter value.

parameters()[source]
pdf(dist)[source]

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)[source]

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)[source]

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

range(low, high)[source]

Allow the parameter to vary within the given range.

residual()[source]

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)[source]

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()[source]

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()[source]

Return true if the parameter is within the valid range.

value = None
class bumps.parameter.Constant(value, name=None)[source]

Bases: bumps.parameter.BaseParameter

An unmodifiable value.

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = False
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

fittable = False
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()

Format the parameter, value and range as a string.

log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()

Return -log(P) for the current parameter value.

parameters()
pdf(dist)

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

range(low, high)

Allow the parameter to vary within the given range.

residual()

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()

Return true if the parameter is within the valid range.

value
class bumps.parameter.Constraint[source]

Bases: object

Abstract base class for constraints.

class bumps.parameter.ConstraintEQ(a, b)

Bases: bumps.parameter.Constraint

Constraint operator ==

class bumps.parameter.ConstraintGE(a, b)

Bases: bumps.parameter.Constraint

Constraint operator >=

class bumps.parameter.ConstraintGT(a, b)

Bases: bumps.parameter.Constraint

Constraint operator >

class bumps.parameter.ConstraintLE(a, b)

Bases: bumps.parameter.Constraint

Constraint operator <=

class bumps.parameter.ConstraintLT(a, b)

Bases: bumps.parameter.Constraint

Constraint operator <

class bumps.parameter.ConstraintNE(a, b)

Bases: bumps.parameter.Constraint

Constraint operator !=

class bumps.parameter.FreeVariables(names=None, **kw)[source]

Bases: object

A collection of parameter sets for a group of models.

names is the set of model names.

The parameters themselves are specified as key=value pairs, with key being the attribute name which is used to retrieve the parameter set and value being a Parameter containing the parameter that is shared between the models.

In order to evaluate the log likelihood of all models simultaneously, the fitting program will need to call set_model with the model index for each model in turn in order to substitute the values from the free variables into the model. This allows us to share a common sample across multiple data sets, with each dataset having its own values for some of the sample parameters. The alternative is to copy the entire sample structure, sharing references to common parameters and creating new parameters for each model for the free parameters. Setting up these copies was inconvenient.

get_model(i)[source]

Get the parameters for model i as {reference: substitution}

parameters()[source]

Return the set of free variables for all the models.

set_model(i)[source]

Set the reference parameters for model i.

class bumps.parameter.Function(op, *args, **kw)[source]

Bases: bumps.parameter.BaseParameter

Delayed function evaluator.

f.value evaluates the function with the values of the parameter arguments at the time f.value is referenced rather than when the function was invoked.

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

args
bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = False
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

fittable = False
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()

Format the parameter, value and range as a string.

kw
log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()

Return -log(P) for the current parameter value.

op
parameters()[source]
pdf(dist)

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

range(low, high)

Allow the parameter to vary within the given range.

residual()

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()

Return true if the parameter is within the valid range.

value
class bumps.parameter.IntegerParameter(value=None, bounds=None, fixed=None, name=None, **kw)[source]

Bases: bumps.parameter.Parameter

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

clip_set(value)

Set a new value for the parameter, clipping it to the bounds.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

classmethod default(value, **kw)

Create a new parameter with the value and kw attributes, or return the existing parameter if value is already a parameter.

The attributes are the same as those for Parameter, or whatever subclass cls of Parameter is being created.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = True
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

feasible()

Value is within the limits defined by the model

fittable = True
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()

Format the parameter, value and range as a string.

log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()

Return -log(P) for the current parameter value.

parameters()
pdf(dist)

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

randomize(rng=None)

Set a random value for the parameter.

range(low, high)

Allow the parameter to vary within the given range.

residual()

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

set(value)

Set a new value for the parameter, ignoring the bounds.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()

Return true if the parameter is within the valid range.

value
class bumps.parameter.OperatorAdd(a, b)

Bases: bumps.parameter.BaseParameter

Parameter operator +

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = False
dvalue
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

fittable = False
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()

Format the parameter, value and range as a string.

log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()

Return -log(P) for the current parameter value.

parameters()
pdf(dist)

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

range(low, high)

Allow the parameter to vary within the given range.

residual()

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()

Return true if the parameter is within the valid range.

value
class bumps.parameter.OperatorDiv(a, b)

Bases: bumps.parameter.BaseParameter

Parameter operator /

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = False
dvalue
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

fittable = False
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()

Format the parameter, value and range as a string.

log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()

Return -log(P) for the current parameter value.

parameters()
pdf(dist)

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

range(low, high)

Allow the parameter to vary within the given range.

residual()

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()

Return true if the parameter is within the valid range.

value
class bumps.parameter.OperatorMul(a, b)

Bases: bumps.parameter.BaseParameter

Parameter operator *

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = False
dvalue
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

fittable = False
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()

Format the parameter, value and range as a string.

log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()

Return -log(P) for the current parameter value.

parameters()
pdf(dist)

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

range(low, high)

Allow the parameter to vary within the given range.

residual()

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()

Return true if the parameter is within the valid range.

value
class bumps.parameter.OperatorPow(a, b)

Bases: bumps.parameter.BaseParameter

Parameter operator **

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = False
dvalue
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

fittable = False
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()

Format the parameter, value and range as a string.

log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()

Return -log(P) for the current parameter value.

parameters()
pdf(dist)

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

range(low, high)

Allow the parameter to vary within the given range.

residual()

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()

Return true if the parameter is within the valid range.

value
class bumps.parameter.OperatorSub(a, b)

Bases: bumps.parameter.BaseParameter

Parameter operator -

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = False
dvalue
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

fittable = False
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()

Format the parameter, value and range as a string.

log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()

Return -log(P) for the current parameter value.

parameters()
pdf(dist)

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

range(low, high)

Allow the parameter to vary within the given range.

residual()

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()

Return true if the parameter is within the valid range.

value
class bumps.parameter.Parameter(value=None, bounds=None, fixed=None, name=None, **kw)[source]

Bases: bumps.parameter.BaseParameter

A parameter is a symbolic value.

It can be fixed or it can vary within bounds.

p = Parameter(3).pmp(10) # 3 +/- 10% p = Parameter(3).pmp(-5,10) # 3 in [2.85,3.3] rounded to 2 digits p = Parameter(3).pm(2) # 3 +/- 2 p = Parameter(3).pm(-1,2) # 3 in [2,5] p = Parameter(3).range(0,5) # 3 in [0,5]

It has hard limits on the possible values, and a range that should live within those hard limits. The value should lie within the range for it to be valid. Some algorithms may drive the value outside the range in order to satisfy soft It has a value which should lie within the range.

Other properties can decorate the parameter, such as tip for tool tip and units for units.

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

clip_set(value)[source]

Set a new value for the parameter, clipping it to the bounds.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

classmethod default(value, **kw)[source]

Create a new parameter with the value and kw attributes, or return the existing parameter if value is already a parameter.

The attributes are the same as those for Parameter, or whatever subclass cls of Parameter is being created.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = False
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

feasible()[source]

Value is within the limits defined by the model

fittable = True
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()

Format the parameter, value and range as a string.

log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()

Return -log(P) for the current parameter value.

parameters()
pdf(dist)

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

randomize(rng=None)[source]

Set a random value for the parameter.

range(low, high)

Allow the parameter to vary within the given range.

residual()

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

set(value)[source]

Set a new value for the parameter, ignoring the bounds.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()

Return true if the parameter is within the valid range.

value = None
class bumps.parameter.ParameterSet(reference, names=None)[source]

Bases: object

A parameter that depends on the model.

get_model(index)[source]

Get the reference and underlying model parameter for the nth model.

pm(*args, **kw)[source]

Like parameter.Parameter.pm(), but applied to all models.

pmp(*args, **kw)[source]

Like parameter.Parameter.pmp(), but applied to all models.

range(*args, **kw)[source]

Like parameter.Parameter.range(), but applied to all models.

set_model(index)[source]

Set the underlying model parameter to the value of the nth model.

values
class bumps.parameter.Reference(obj, attr, **kw)[source]

Bases: bumps.parameter.Parameter

Create an adaptor so that a model attribute can be treated as if it were a parameter. This allows only direct access, wherein the storage for the parameter value is provided by the underlying model.

Indirect access, wherein the storage is provided by the parameter, cannot be supported since the parameter has no way to detect that the model is asking for the value of the attribute. This means that model attributes cannot be assigned to parameter expressions without some trigger to update the values of the attributes in the model.

arccos(**kw)

acos(x)

Return the arc cosine (measured in radians) of x.

arccosh(**kw)

acosh(x)

Return the inverse hyperbolic cosine of x.

arcsin(**kw)

asin(x)

Return the arc sine (measured in radians) of x.

arcsinh(**kw)

asinh(x)

Return the inverse hyperbolic sine of x.

arctan(**kw)

atan(x)

Return the arc tangent (measured in radians) of x.

arctanh(**kw)

atanh(x)

Return the inverse hyperbolic tangent of x.

bounds

Fit bounds

ceil(x)

Return the ceiling of x as a float. This is the smallest integral value >= x.

clip_set(value)

Set a new value for the parameter, clipping it to the bounds.

cos(x)

Return the cosine of x (measured in radians).

cosh(x)

Return the hyperbolic cosine of x.

classmethod default(value, **kw)

Create a new parameter with the value and kw attributes, or return the existing parameter if value is already a parameter.

The attributes are the same as those for Parameter, or whatever subclass cls of Parameter is being created.

degrees(x)

Convert angle x from radians to degrees.

dev(std, mean=None, limits=None, sigma=None, mu=None)

Allow the parameter to vary according to a normal distribution, with deviations from the mean added to the overall cost function for the model.

If mean is None, then it defaults to the current parameter value.

If limits are provide, then use a truncated normal distribution.

Note: sigma and mu have been replaced by std and mean, but are left in for backward compatibility.

discrete = False
exp(x)

Return e raised to the power of x.

expm1(x)

Return exp(x)-1. This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.

feasible()

Value is within the limits defined by the model

fittable = True
fixed = True
floor(x)

Return the floor of x as a float. This is the largest integral value <= x.

format()

Format the parameter, value and range as a string.

log(x[, base])

Return the logarithm of x to the given base. If the base not specified, returns the natural logarithm (base e) of x.

log10(x)

Return the base 10 logarithm of x.

log1p(x)

Return the natural logarithm of 1+x (base e). The result is computed in a way which is accurate for x near zero.

name = None
nllf()

Return -log(P) for the current parameter value.

parameters()
pdf(dist)

Allow the parameter to vary according to any continuous scipy.stats distribution.

pm(*args)

Allow the parameter to vary as value +/- delta.

pm(delta) -> [value-delta, value+delta]

pm(plus, minus) -> [value+minus, value+plus]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

pmp(*args)

Allow the parameter to vary as value +/- percent.

pmp(percent) -> [value*(1-percent/100), value*(1+percent/100)]

pmp(plus, minus) -> [value*(1+minus/100), value*(1+plus/100)]

In the plus/minus form, one of the numbers should be plus and the other minus, but it doesn’t matter which.

The resulting range is converted to “nice” numbers.

radians(x)

Convert angle x from degrees to radians.

randomize(rng=None)

Set a random value for the parameter.

range(low, high)

Allow the parameter to vary within the given range.

residual()

Return the z score equivalent for the current parameter value.

That is, the given the value of the parameter in the underlying distribution, find the equivalent value in the standard normal. For a gaussian, this is the z score, in which you subtract the mean and divide by the standard deviation to get the number of sigmas away from the mean. For other distributions, you need to compute the cdf of value in the parameter distribution and invert it using the ppf from the standard normal distribution.

set(value)

Set a new value for the parameter, ignoring the bounds.

sin(x)

Return the sine of x (measured in radians).

sinh(x)

Return the hyperbolic sine of x.

soft_range(low, high, std)

Allow the parameter to vary within the given range, or with Gaussian probability, stray from the range.

sqrt(x)

Return the square root of x.

tan(x)

Return the tangent of x (measured in radians).

tanh(x)

Return the hyperbolic tangent of x.

to_dict()

Return a dict represention of the object.

trunc(x:Real) → Integral

Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.

valid()

Return true if the parameter is within the valid range.

value
bumps.parameter.acosd(*args, **kw)[source]

Return the arc cosine (measured in in degrees) of x.

bumps.parameter.arccosd(*args, **kw)

Return the arc cosine (measured in in degrees) of x.

bumps.parameter.arcsind(*args, **kw)

Return the arc sine (measured in in degrees) of x.

bumps.parameter.arctan2(*args, **kw)

atan2(y, x)

Return the arc tangent (measured in radians) of y/x. Unlike atan(y/x), the signs of both x and y are considered.

bumps.parameter.arctan2d(*args, **kw)

Return the arc tangent (measured in in degrees) of y/x. Unlike atan(y/x), the signs of both x and y are considered.

bumps.parameter.arctand(*args, **kw)

Return the arc tangent (measured in in degrees) of x.

bumps.parameter.asind(*args, **kw)[source]

Return the arc sine (measured in in degrees) of x.

bumps.parameter.atan2d(*args, **kw)[source]

Return the arc tangent (measured in in degrees) of y/x. Unlike atan(y/x), the signs of both x and y are considered.

bumps.parameter.atand(*args, **kw)[source]

Return the arc tangent (measured in in degrees) of x.

bumps.parameter.boxed_function(f)[source]
bumps.parameter.cosd(*args, **kw)[source]

Return the cosine of x (measured in in degrees).

bumps.parameter.current(s)[source]
bumps.parameter.fittable(s)[source]

Return the list of fittable parameters in no paraticular order.

Note that some fittable parameters may be fixed during the fit.

bumps.parameter.flatten(s)[source]
bumps.parameter.format(p, indent=0, freevars={}, field=None)[source]

Format parameter set for printing.

Note that this only says how the parameters are arranged, not how they relate to each other.

bumps.parameter.function(op)[source]

Convert a function into a delayed evaluator.

The value of the function is computed from the values of the parameters at the time that the function value is requested rather than when the function is created.

bumps.parameter.randomize(s)[source]

Set random values to the parameters in the parameter set, with values chosen according to the bounds.

bumps.parameter.sind(*args, **kw)[source]

Return the sine of x (measured in in degrees).

bumps.parameter.substitute(a)[source]

Return structure a with values substituted for all parameters.

The function traverses lists, tuples and dicts recursively. Things which are not parameters are returned directly.

bumps.parameter.summarize(pars, sorted=False)[source]

Return a stylized list of parameter names and values with range bars suitable for printing.

If sorted, then print the parameters sorted alphabetically by name.

bumps.parameter.tand(*args, **kw)[source]

Return the tangent of x (measured in in degrees).

bumps.parameter.unique(s)[source]

Return the unique set of parameters

The ordering is stable. The same parameters/dependencies will always return the same ordering, with the first occurrence first.

bumps.parameter.varying(s)[source]

Return the list of fitted parameters in the model.

This is the set of parameters that will vary during the fit.