Replies: 6 comments 13 replies
-
It's a good idea to have more separation between parameters. I'm not sure if we'll use |
Beta Was this translation helpful? Give feedback.
-
Following a discussion with @andped10 I updated the ADR suggestion to reflect a somewhat important change. In the new implementation, the unit of a This choice is made to avoid the issue of potential users forgetting to update constraints or models after changing the unit type. |
Beta Was this translation helpful? Give feedback.
-
There can be two types of
The values of these types are not always the same, as the user may want to apply more strict constraints on the parameter value during minimisation than physical constraints. |
Beta Was this translation helpful? Give feedback.
-
For the parameter, I would suggest renaming the property |
Beta Was this translation helpful? Give feedback.
-
For the parameter, I would also suggest using the property For example,
|
Beta Was this translation helpful? Give feedback.
-
Finalized in the ADR #25 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
General
To build a model we need to be able to specify variables of various types. The variables used in the model can be divided into two groups. The ones that are assigned a value and remain unchanged,
Descriptors
, and the other ones that change,Parameter
. The latter tend to be the ones that are fitted to get a match between experimental observations and model predictions.Descriptors
To handle variables that can be considered "static" (rarely change after the model has been constructed) we use descriptors. The types of descriptors in use are
bool
,string
, ornumber
values, which all share some base functionality contained in a base class.DescriptorBase
All type specific descriptors inherit from this base class. The main properties of the base class are:
name
, name of this object (decorated with undo/redo functionality)display_name
, optional pretty name for the object (decorated with undo/redo functionality)description
, optional summary of what this object is forurl
, optional lookup url for documentation/informationparent
, optional link to the object which this descriptor is attached toDescriptorBool
The
bool
descriptor holds the value of abuiltin bool
type. The additional property is:value
, utilized to hold the value (decorated with undo/redo functionality)DescriptorStr
The
str
descriptor holds the value of abuiltin string
type. The additional property is:value
, utilized to hold the value (decorated with undo/redo functionality)DescriptorNumber
The
number
is different from the two former descriptors as it is continuous. Furthermore it can be assigned a physical unit and a variance for the value. To provide this functionally the value is kept in a [scipp scalar
]. The additional properties are:(https://scipp.github.io/generated/functions/scipp.scalar.html)value
, the numerical value of the variable (decorated with undo/redo functionality)unit
, optional physical unit for the numerical value (decorated with undo/redo functionality)variance
, optional variance for the value (decorated with undo/redo functionality)full_value
, the full scipp scalar holding all the above mentioned properties (decorated with undo/redo functionality)To minimize user errors and simplify constraints, the
unit
andfull_value
cannot be changed after initialization. The unit can be converted between allowed types with the convert_unit method.Parameter
The
Parameter
class inherits fromDescriptorNumber
and serves to hold model variables that change. Such changes could be when fitting the model towards experimental data. The additional properties are:min
, optional minimum for the interval for the value (decorated with undo/redo functionality)max
, optional maximum for the interval for the value (decorated with undo/redo functionality)free
(wasfixed
), optional sets if the parameter is allowed to vary while fitting (decorated with undo/redo functionality)unconstrained
(wasenabled
), optional sets if the objects value can be set or if constraints are applied (decorated with undo/redo functionality)callback
, optional callback that serves as a link between the object and a potentialCalculator
Beta Was this translation helpful? Give feedback.
All reactions