-
Notifications
You must be signed in to change notification settings - Fork 4
Description
The 'append' method of adding a group of parameters, as described in the manual, is very clunky and not what we need.
For example, in the tutorial we have an example which adds three parameters like this:
pGroup = [RAT.models.Parameter(name='Layer thick', min=10, value=20, max=30, fit=True),
RAT.models.Parameter(name='Layer SLD', min=1e-6, value=3e-6, max=5e-6, fit=True),
RAT.models.Parameter(name='Layer rough', min=5, value=7, max=10, fit=True)]
problem.parameters.extend(pGroup)
This is a lot of typing!
In fact, all the relevant information from that can be summarised in a simple list:
In [4]: myParams = [['Layer thick',10,20,30,True], ['Layer SLD', 1e-6, 3e-6, 5e-6, True], ['Layer rough',5,7,10,True]]
In [5]: print(myParams)
[['Layer thick', 10, 20, 30, True], ['Layer SLD', 1e-06, 3e-06, 5e-06, True], ['Layer rough', 5, 7, 10, True]]
The addParamGroup option should accept a simple list like this, and then do the Rat.models.Parameter... stuff under the hood for the user. This method would then be in alignment with the Matlab one, where a simple cell array is used to define the parameter block.
A