-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
helper and viewer-level access to data_labels properties #2626
Conversation
9056070
to
c7c536f
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2626 +/- ##
==========================================
- Coverage 91.53% 91.52% -0.01%
==========================================
Files 161 161
Lines 19944 19983 +39
==========================================
+ Hits 18256 18290 +34
- Misses 1688 1693 +5 ☔ 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.
Philosophical questions posted, as you requested. 🧐
@@ -36,25 +36,55 @@ def __init__(self, *args, **kwargs): | |||
@property | |||
def user_api(self): | |||
# default exposed user APIs. Can override this method in any particular viewer. | |||
expose = ['data_labels', 'data_labels_loaded', 'data_labels_visible'] |
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.
Hmm...
- Does this include Mosviz table viewer? Do we want to expose these for Mosviz?
- How do you want the Imviz fake WCS layers to behave for this? Are they not exposed here even though people can see them in the Data drop down?
- I am guessing for Cubeviz case, the spectrum viewer will say it has no data labels even though a spectrum is visible because of the collapse magic?
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.
Does this include Mosviz table viewer? Do we want to expose these for Mosviz?
Good point, I'll exclude from the user-API for table viewers
How do you want the Imviz fake WCS layers to behave for this? Are they not exposed here even though people can see them in the Data drop down?
Good question, they will show up here , and maybe we will want to exclude them. If that's what we want, I can do a follow-up PR to the image rotation PR once its rebased on this or merged into main.
I am guessing for Cubeviz case, the spectrum viewer will say it has no data labels even though a spectrum is visible because of the collapse magic?
No, the spectrum should still show up as it is a data layer loaded into that viewer.
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.
Excluded now from mosviz, and confirmed that the cube shows up as expected in the spectrum viewer (and matching the UI as of #2631).
I also cross linked back here from the image rotation PR so that we can consider your second question then.
a117cef
to
8a9dfdf
Compare
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.
LGTM. Thanks!
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 tested the implementation in Imviz and confirmed that it performs as expected. Thanks for your work!
Description
This pull request implements
viz.data_labels
,viz.viewers[...].data_labels_loaded
, andviz.viewers[...].data_labels_visible
which are each a read-only list. This is intended to provide an alternative to suggesting users accessviz.app.data_collection
to inspect the list of data labels eligible to be passed toviz.get_data()
, etc.In the future,
viz.viewer[...].data_labels
as a list of all data entries supported by a specific viewer (those loaded as well as those in the expanded data menu) would be convenient, but currently all that logic lives in vue, not python.See spacetelescope/jdat_notebooks#203 for how this would allow us to remove non-public API from public-facing notebook examples.
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.