-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add fitting test (and refactor scripts) #113
Conversation
2975e2b
to
bd1346b
Compare
Codecov Report
@@ Coverage Diff @@
## master #113 +/- ##
===========================================
+ Coverage 54.71% 75.80% +21.08%
===========================================
Files 4 5 +1
Lines 265 310 +45
===========================================
+ Hits 145 235 +90
+ Misses 120 75 -45
Continue to review full report at Codecov.
|
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.
Looks good! Perhaps consider some of the changes I propose in my comments, otherwise it seems good as it is, and definitely looks much cleaner now.
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.
Looks good to me overall.
One question: for 'test_fitting_spitzer.py', you use maxiter=200 (ln 17) while the default is set to 1000. Is this to decrease the time for testing or is this a leftover from the previous setting?
And how do I show that part of the code in this comment (like Alexandros did)?
For testing so it is fully reproducible regardless of the default maxiter setting. And to reduce the time needed. |
If you go to the "Files changed" tab, you can highlight specific lines and add a comment/review. Use your mouse and the "+" symbols. |
Thanks. |
Two reviews enough? I think it is ready to merge. |
Fine with me. But there is one check which was unsuccessful ... |
This is codacy being over careful in the default value for a variable in a function definition. It can be ignored. |
Add in a fitting test. Simply reads in the spitzer scipack and M101 nucleus spectrum, runs the fit, and then compares the fit parameters to a cached array of the parameters. Will fail if the parameters are not close (machine precision I think).
Refactored run_pahfit and plot_pahfit scripts to have common functions to avoid code duplication and allow for easier testing. This refactoring will also make it easier to support other fitters, units, etc. in the future.