Is your feature request related to a problem? Please describe.
Fit functions define attributes to pass through values that are not part of the optimization set but can change how the function is evaluated, e.g the number of iterations of a loop. Our current system does not allow any validation/restriction on values that are allowed for these attributes beyond throwing exceptions in Function::setAttributeValue.
Recently it was desired to create a function that would accept a string attribute for the unit of evaluation of the function but the users want to ensure that the string could only have 2 values. Our code currently has very limited for possibilities for this at the framework level and the it is not possible to change the control at the GUI level at all without handwriting the code for that function.
Describe the solution you'd like
Extend the attribute system within fit functions to allow validators used for algorithm properties to be used with fit functions, e.g when writing a fit function I can do:
I see this feature being broken down in to several parts:
[x] Framework: Allow functions derived from IFunction to declare attributes with a validator in C++ #33120
[x] Framework: Extend allowing attribute validators to Python functions #33121
[x] GUI: Enhance the base FitPropertyBrowser to make use of validators if set, this should include
[x] feedback to the user if the value entered is incorrect #33122
[x] in cases such as the string list validator above then the control should change to a combination box so the input cannot be wrong. #33123
Describe alternatives you've considered
The alternative is separate functions for each attribute value but this grows combinatorially with multiple attribute values.
Is your feature request related to a problem? Please describe. Fit functions define attributes to pass through values that are not part of the optimization set but can change how the function is evaluated, e.g the number of iterations of a loop. Our current system does not allow any validation/restriction on values that are allowed for these attributes beyond throwing exceptions in
Function::setAttributeValue
.Recently it was desired to create a function that would accept a string attribute for the unit of evaluation of the function but the users want to ensure that the string could only have 2 values. Our code currently has very limited for possibilities for this at the framework level and the it is not possible to change the control at the GUI level at all without handwriting the code for that function.
Describe the solution you'd like
Extend the attribute system within fit functions to allow validators used for algorithm properties to be used with fit functions, e.g when writing a fit function I can do:
I see this feature being broken down in to several parts:
IFunction
to declare attributes with a validator in C++ #33120FitPropertyBrowser
to make use of validators if set, this should includeDescribe alternatives you've considered The alternative is separate functions for each attribute value but this grows combinatorially with multiple attribute values.
Additional context