-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce heuristic attribute and change parameter initialisation #45
Conversation
I have run unit tests, all work except one that throws
Not sure if this is caused by the configuration of the pc I am using. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I think this is a nice positive change.
A few stylistic points to consider. The most substantive thing is the unwanted change of behaviour by no longer using x = self.parameters["x"].initialise(value)
.
All tests finish correctly |
@hartytp Let me know if you are happy with the docstrings now. |
which one? |
Those for |
I believe this is ready to be merged |
Can you sort the test failure out though https://github.com/OxIonics/ionics_fits/actions/runs/3429613116/jobs/5715467301#step:8:30 |
7589701
to
fb03749
Compare
🎆 |
This PR modifies the way in which initial values for parameters are obtained. An attribute
heuristic
has been added to theModelParameter
class, which is used if both offixed_to
andinitialised_to
areNone
. There is now only one method to get the initial guess for parameters during fitting, calledget_initial_value
. This method may returnNone
only beforeestimate_parameters
has been called. Ifget_initial_value
returnsNone
for any parameter after pre-fit estimation has been completed, the fitter raises an error.As part of this PR, bound checking for fixed parameters is added. Functionality is further changed such that if the initial value is outside bounds, an error is thrown rather than silently clipping the parameter.