-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fix specviz2d model fit linking #3434
base: main
Are you sure you want to change the base?
Conversation
without this patch
assert len(specviz2d_helper.app.data_collection) == 3 # model is created | ||
|
||
elink = specviz2d_helper.app.data_collection.external_links[-1] | ||
assert elink.data1.label == "Spectrum 1D" and elink.data2.label == "model", (elink.data1.label, elink.data2.label) # noqa: E501 |
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.
Without this patch, this test would fail on main
as such:
> assert elink.data1.label == "Spectrum 1D" and elink.data2.label == "model", (elink.data1.label, elink.data2.label) # noqa: E501
E AssertionError: ('Spectrum 2D', 'model')
E assert ('Spectrum 2D' == 'Spectrum 1D'
E
E - Spectrum 1D
E ? ^
E + Spectrum 2D
E ? ^)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3434 +/- ##
=======================================
Coverage 87.53% 87.53%
=======================================
Files 128 128
Lines 19962 19962
=======================================
Hits 17474 17474
Misses 2488 2488 ☔ View full report in Codecov by Sentry. |
Question for @gibsongreen , is this still needed after #2736 ? |
I tested on main a bit and was having trouble reproducing the original bug. I just tested on the commit prior to merging said PR and saw y ~= 0 (horizontal line) instead of a vertical line of x = 1 (in essence the same issue). #2736 definitely positively impacted the modeling fitting, let me test a few more spectra and see if I can still find the bug on main. |
I tested a few more spectra on main and still haven't been able to reproduce the bug, if you and @cshanahan1 see the same thing then maybe the app.py logic can be scrapped, but it is still beneficial to merge the additional test coverage added here. |
@gibsongreen if you run just that test on |
can we just try removing the code changes from this PR but keeping the regression test? If that passes, then we know the previous PR fixed the problem as well and we can get the test in here, right? |
I did that locally. It fails without the patch. But I also don't grok specviz2d linking. |
We could look at the mark that was created for the model and calculate the min/max for y and x, get the min and max values also for the spectrum, and see if the model mark is within the bounds of the spectrum. It would be somewhat similar to the test here only would also have to account for y: jdaviz/jdaviz/tests/test_subsets.py Line 772 in 4cfa7a1
|
Since the original bug I am trying to fix is no longer reproducible and the test I added here becomes irrelevant, I motion the following action items:
|
Description
This pull request is to fix modeling fitting linking in Specviz2D so that fitted model does not appear weird over
x=0
and would instead plot properly on 1D spectrum viewer. We do not support 2D model fit, so it will never have to display in 2D spectrum viewer.With this patch:
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.