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.

  • asym_errors (tuple(float, float)) – asymmetric errors.

Variables
  • name – name of the parameter.

  • error – error of the parameter.

Attributes Summary

bounds

Bounds of the parameter, defining the full range.

constant

Whether this parameter is marked as constant.

dependent

ranges

Names of the parameter ranges.

value

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.

restoring_state()

Enter a context where the attributes of the parameter will be restored on exit.

set_range(name, values)

Define the range with name name.

to_json_object()

Represent this class as a JSON-like object.

Attributes Documentation

bounds

Bounds of the parameter, defining the full range.

Type

numpy.ndarray

constant

Whether this parameter is marked as constant.

Type

bool

dependent = False
ranges

Names of the parameter ranges.

value

Value of the parameter.

Type

float

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.

Parameters

obj (dict) – object to use to construct the class.

Returns

parameter created from the JSON object.

Return type

Parameter

get_range(name)[source]

Get the range with the given name.

Parameters

name (str) – name of the range.

Returns

attached range.

Return type

numpy.ndarray

restoring_state()[source]

Enter a context where the attributes of the parameter will be restored on exit.

set_range(name, values)[source]

Define the range with name name. Must not be full.

Parameters
  • name (str) – name of the range.

  • values (tuple or tuple(tuple, ..)) – bounds of the range.

to_json_object()[source]

Represent this class as a JSON-like object.

Returns

this class as a JSON-like object.

Return type

dict