Parameter¶
-
class
minkit.
Parameter
(name, value=None, bounds=None, ranges=None, error=0.0, constant=False, asym_errors=None)[source]¶ Bases:
minkit.ParameterBase
Object to represent a parameter for a PDF.
- Parameters
name (str) – name of the parameter.
value (float) – initial value.
bounds (tuple or tuple(tuple, ..)) – bounds for the parameter. This defines the full range.
ranges (dict(str, tuple) or dict(str, tuple(tuple, ..))) – possible ranges
error (float) – error of the parameter.
constant (bool) – whether to initialize this parameter as constant.
- Variables
name – name of the parameter.
error – error of the parameter.
Attributes Summary
Bounds of the parameter, defining the full range.
Whether this parameter is marked as constant.
Names of the parameter ranges.
Value of the parameter.
Methods Summary
copy
()Create a copy of this instance.
from_json_object
(obj)Build the parameter from a JSON object (a dictionary).
get_range
(name)Get the range with the given name.
Enter a context where the attributes of the parameter will be restored on exit.
set_range
(name, values)Define the range with name name.
Represent this class as a JSON-like object.
Attributes Documentation
-
bounds
¶ Bounds of the parameter, defining the full range.
- Type
-
dependent
= False¶
-
ranges
¶ Names of the parameter ranges.
Methods Documentation
-
copy
()[source]¶ Create a copy of this instance.
Warning
Avoid calling this method directly for sets of parameters and use the
Registry.copy()
method instead, so the possible dependencies among parameters are correctly solved.
-
classmethod
from_json_object
(obj)[source]¶ Build the parameter from a JSON object (a dictionary). This is meant to be used together with the
json
module.
-
get_range
(name)[source]¶ Get the range with the given name.
- Parameters
name (str) – name of the range.
- Returns
attached range.
- Return type
-
restoring_state
()[source]¶ Enter a context where the attributes of the parameter will be restored on exit.