-
Notifications
You must be signed in to change notification settings - Fork 2
Fitting preparation #8
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
Conversation
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.
This pull request does not contain a valid label. Please add one of the following labels: ['chore', 'fix', 'bugfix', 'bug', 'enhancement', 'feature', 'dependencies', 'documentation']
if TYPE_CHECKING: | ||
from easyscience.Fitting.Fitting import Fitter | ||
from easyscience.Fitting import Fitter |
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.
Only update to import path. Other changes in file are only text formatting
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.
This looks both benign (in scope) and very useful (for readibility)
Just a question on naming a class, but ready to merge anyway
|
||
|
||
class lmfit(FittingTemplate): # noqa: S101 | ||
class LmFit(MinimizerBase): # noqa: S101 | ||
""" | ||
This is a wrapper to lmfit: https://lmfit.github.io/ |
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.
The correct link is https://lmfit.github.io/lmfit-py/
The current link gives a 404
|
||
|
||
class lmfit(FittingTemplate): # noqa: S101 | ||
class LmFit(MinimizerBase): # noqa: S101 |
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.
I am not sure about CamelCase here.
LM stands for Levenberg-Marquardt - maybe LMFit
? This would be similar to other acronym-containing class names. Did we agree on naming?
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.
Yes, you are right. It seems better to have acronyms capitalized in a class name.
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.
I just didn't remember if we said anything about acronyms in names, but considering we are dealing with many of those (e.g. QENS, INS) we should have a clear rule
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.
In my opinion:
- module names should always be small caps (file tree)
- class names should have CamelCase for the individual words. If acronym is part of the name it should be ALLCAPS
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.
I guess this should be an ADR on the organization level.
This PR is just preparation for more fundamental changes of the Fitter code base. No changes have yet been made to the logic. Only moving stuff around to clarify what is going on.
Next step is to make tests.
Main changes
Split
Fitting.py
into:fitter.py
multi_fitter.py
Introduce dir for the minimizers (engines)
Fitting.minimizers
Renaming:
fitting_template.py
->minimizer_base.py
Extracted functionality from
minimizer.minimizer_base.py
intominimizer.utils.py
Moved fitter test from
unit_tests
intointegration_tests
Only change to module import path:
Objects.Inferface.py
, other changes are just text formatting