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
plot residual #3186
plot residual #3186
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## RELEASE_next_major #3186 +/- ##
======================================================
+ Coverage 81.25% 81.27% +0.01%
======================================================
Files 173 173
Lines 24192 24203 +11
Branches 5621 5622 +1
======================================================
+ Hits 19657 19670 +13
+ Misses 3236 3234 -2
Partials 1299 1299
☔ View full report in Codecov by Sentry. |
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.
Thanks for the PR! I've added some general linting comments below as well as a few suggestions.
hyperspy/models/model1d.py
Outdated
|
||
def _residual2plot(self, axes_manager, out_of_range2nans=True): | ||
old_axes_manager = None | ||
if axes_manager is not self.axes_manager: |
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.
Could you document what happens here?
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 have added documentation for _residual_for_plot.
Hey @thomasaarholt thanks for reviewing. |
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.
Thank you @HanHsuanWu, this works well and is a long overdue!
I have suggested some simplification.
This would need a changelog entry.
What is a changelog entry and where do I add this? |
See https://github.com/hyperspy/hyperspy/blob/RELEASE_next_minor/upcoming_changes/README.rst as per checklist of the first comment of the PR. |
Thanks Eric. I have added the changelog. Got a bit confused before. |
@ericpre any further comments for this pull request? |
Sorry, I don't have time at the minute, I will come back to it very soon. |
Co-authored-by: Eric Prestat <eric.prestat@gmail.com>
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.
Thanks @HanHsuanWu, this looks good.
In 18a019a I added a test and an example. I have also rebased on the RELEASE_next_major
branch as the next release will be the 2.0.
Description of the change
A few sentences and/or a bulleted list to describe and motivate the change:
As suggested by @thomasaarholt on gitter, I added a plot_residual argument to model1d.plot.
This argument will plot a residual signal (Signal - Model) to the signal plot.
Currently, it has a bug when the size of signal and model are not the same. I am not sure what's the best way to do this so any help is appreciated.
Progress of the PR
upcoming_changes
folder (seeupcoming_changes/README.rst
),readthedocs
doc build of this PR (link in github checks)Minimal example of the bug fix or the new feature