-
Notifications
You must be signed in to change notification settings - Fork 0
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 warning when less than 2 data have WCS #13
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.
just a small performance-suggestion, otherwise looks good to me. We might want to tweak the language a bit if anyone finds it confusing, but that can be done as we review the larger PR.
Co-authored-by: Kyle Conroy <[email protected]>
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.
Leaving some changes for future ease of reading/maintaining, and one point where I'm confused if it works.
num_data_with_wcs = 0 | ||
for data in self.app.data_collection: | ||
if hasattr(data.coords, 'pixel_to_world'): | ||
if num_data_with_wcs: |
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.
Shouldn't this be
if num_data_with_wcs: | |
if num_data_with_wcs > 1: |
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 think so, the increment happens below this line, so this is just saying if there was already one with WCS, making this the second entry, then enable linking and stop looping. But let's definitely add a comment that clears this up, I can see how it is confusing to read 😬
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 added a comment explaining what is happening at this step, please let me know if that is sufficient!
Co-authored-by: Brett M. Morris <[email protected]>
We should test this for the case of original rotation of a single image layer (which might be another motivation for eventually changing the name of the plugin... but that's out of scope here) |
@kecnry Rotating a single image worked for me. Hopefully you both see the same thing! |
@kecnry So canvas rotation still works with only 1 data loaded into the viewer and if you try to link by wcs with 1 data, it looks like nothing happens. Should I revert the last commit? |
Canvas rotation will be removed soon (see #9) I do see though that the linking itself fails and fallsback on pixel linking, but we need a way to still use the image rotation logic with only a single layer (that has valid WCS). @bmorris3 - can some logic be moved around so the default orientation is created immediately when requesting WCS-linking so that it can then link against that? |
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.
To make the single-data with WCS case work, we need to change this line:
jdaviz/jdaviz/configs/imviz/helper.py
Line 520 in 842c5d0
]) > 1 |
to be
> 0
rather than > 1
.
Description
This pull request adds a warning message in the Links Control plugin when
less than 2no data in data collection has valid WCS.EDIT:
I tried to support data deletion as well but noticed some bugs when deleting data in this PR. Please let me know if that is just on my end.
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.