Bases: misctools.base.Validable
Creates a new Parameter. This class is used by _ParametersSimulation to create a series of experiment testing many parameters.
A parameter is an abstraction linking the options of a simulation to a series of experiments. It is only valid for numerical options. It is designed to be used to create a batch of simulations.
The link between the parameter and the options of a simulation is given by specifying the attribute of this parameter. The attribute is the path from the options class to access this parameter. For example, the attribute for the beam energy is source.beam_energy`, or the attribute for the diameter of an inclusion (if the :class:`.Inclusion` is selected) is ``geometry.inclusion_diameter.
Apart from the attribute, a parameter requires a name, a string to represent it, the units it carries and the lower and upper limit for the values it can accept. If there is no limit, None can be set as the limit.
After the parameter is instantiated, one can specify the range of the values this parameter will take. The _ParameterSimulation will automatically generate experiments for all these values. The range is set-up by specifying the lower value (value_low), upper value (value_high) and the step size (step).
Parameters: |
|
---|
Attribute of the parameter. The attribute is the path from the options class to access this parameter. For example, the attribute for the beam energy is source.beam_energy.
Returns the range of values between the lower and the upper value at the specified interval.
Return type: | list |
---|
Upper limit of the parameter. If None, no limit is enforced.
Lower limit of the parameter. If None, no limit is enforced.
Name of the parameter.
The interval of the range. The value is stored in a magnitude.Magnitude with the specified units in the constructor.
Checks that the lower value is smaller than the upper value. Raises ValueError
Upper value of the range. The range will end at this value. The upper value must be lower or equal to the upper limit. The value is stored in a magnitude.Magnitude with the specified units in the constructor.
Lower value of the range. The range will start from this value. The lower value must be higher or equal to the lower limit. The value is stored in a magnitude.Magnitude with the specified units in the constructor.