-
Notifications
You must be signed in to change notification settings - Fork 75
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
footprints: filter by observatory #3345
Conversation
jdaviz/core/template_mixin.py
Outdated
@observe('filters') | ||
def _update_items(self, msg={}): | ||
all_items = [self._to_item(opt) for opt in self.manual_options] | ||
self.items = [item for item in all_items if self._is_valid_item(item)] |
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.
adding this to the base class then requires renaming all the inheriting classes to have their methods renamed so that they properly override this instead of resulting in duplicated functionality.
82203ff
to
ceab93f
Compare
* manual options can be either strings or dictionaries * filters passed to SelectPluginComponent will act on manual items, classes that subclass SelectPluginComponent may choose to ALWAYS include all manual items, ignoring filters
* and expose to user API
Co-authored-by: Jennifer Kotler <[email protected]>
c1b3878
to
f135ad5
Compare
f135ad5
to
bfdeb50
Compare
* manual options always last * actually assign to correct select
I'm stumped by these test failures (seems the remote data builds are failing to find the new icons for some reason), but will investigate. Reviews should be able to continue in the meantime - I expect the fix to be pretty minor as far as the diff is concerned. |
Are you sure we do not have to include them as package data? |
Maybe we need to add Line 115 in a0d77f5
|
p.s. I am really not sure. Can you reproduce this locally with remote data flag? |
6a4ac6d
to
53dcc7d
Compare
may have just been a case issue, although no idea why that didn't complain locally or on the other tests 🤷♂️ |
Ah, okay! OSX (which is probably what you using) is case-insensitive but Linux is case-sensitive. |
subset = self.app.get_subsets(self.subset.selected) | ||
try: | ||
subset = self.app.get_subsets(self.subset.selected) | ||
except Exception: | ||
# subset invalid message will already be set, | ||
# no need to set valid/invalid formats. | ||
return |
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.
this is needed here because adding support for filtering the select dropdowns meant that this line was getting triggered and raising an exception. Without this PR, this traceback could still be triggered by going to the export plugin on an invalid subset (e.g., AND logic but not overlapping), but now it was being triggered in the test when importing the subset instead of when accessing it.
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.
technically these aren't used, but I figure they might be useful at some point and don't really take much space. I can remove from here though if we'd rather wait until we need them?
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, I like the icons. Might have to rethink those if we eventually support more predefined mission footprints but it's fine for now.
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.
This works great. I'm a little bummed how often we have to customize and call _update_items
(formerly known as _update_layer_items
), but hopefully it'll asymptotically converge.
Thanks again to @Jenneh too for the icons!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3345 +/- ##
==========================================
- Coverage 88.76% 88.70% -0.06%
==========================================
Files 125 125
Lines 19231 19291 +60
==========================================
+ Hits 17071 17113 +42
- Misses 2160 2178 +18 ☔ View full report in Codecov by Sentry. |
Description
This pull request extends on #3322 by allowing to filter by mission (JWST or Roman) via buttons in the UI or the
preset_obs
select component in the API.Screen.Recording.2024-12-10.at.11.12.44.AM.mov
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.