Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
BUG: Fix wrong Subset unit when created in 2D spectrum viewer #3201
BUG: Fix wrong Subset unit when created in 2D spectrum viewer #3201
Changes from 3 commits
b1a3031
9dc6d6e
fe250fa
e4d6311
3e501c0
eafb391
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
what does
data[0]
assume? That that is the full cube extracted spectrum? If that is the assumption, maybe we need to be more explicit and request it by label instead? What if that has been unloaded from the viewer?I still wish this could be generalized, but I see how its difficult since
data
in the else is the glue component, butdata
in theif
is a Spectrum1D (or other translated object). Although the else in the else then uses a handler to convert to a Spectrum1D anyways. 🤔If all we need here are the units of the x-axis of the spectrum viewer... can we just access the display units? Or do we need the native units of the "reference" data?
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 don't know the answers. This block is really for Cubeviz and I am trying to patch Specviz2D. Do I really have to fix Cubeviz too?
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.
Fair, ignore my first line of questions then since those do apply to the old code. But I think if we can have a general block here that applies to cubeviz and specviz2d, that would be easier to maintain than if-statements, right? There is even a TODO comment immediately above suggesting switching to display units - so maybe we can simplify this all down to one line once @gibsongreen enables display units across all configs?
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.
(or maybe it makes sense to get this in like this now and either roll that into @gibsongreen's WIP or as a tech-debt follow-up after that makes it in as well?)
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.
ok, we have decided to revisit this after unit conversion is enabled across all configs and merge the logic as-is until then. 🐱
Check warning on line 1076 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L1076
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 have used the API from #3104 but since it is not merged yet, I didn't.
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.
#3104 is now merged but the API is not yet public. Should I keep this as-is or should I use the
helper.plugins['Subset Tools']._obj.import_region(...)
syntax 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 confirmed that this line throws exception on
main
without this patch, but passes with this patch. Exception onmain
: