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
Add API to rename subsets #3356
Add API to rename subsets #3356
Changes from 29 commits
644c6fa
33c29a4
d276f7c
8a760f9
354d9f8
68bcf15
fa75705
ff18e05
dafdd7c
5bf5c72
9ce2c0d
b1afe39
7b7466f
575bdee
394afd0
6eb5156
1a195ae
2aa8afc
c1c857d
f579ab1
ecdaf94
03ba4ce
4e1a694
79ee99a
4c431a9
fe0f198
5b69487
70d4058
5e4b424
2f35bc1
1f1978e
cbc0698
c64656e
cf79558
8e95d39
851f200
0d74275
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 2024 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2024
Check warning on line 2039 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2039
Check warning on line 2044 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2042-L2044
Check warning on line 2052 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2052
Check warning on line 2054 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2054
Check warning on line 2063 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2060-L2063
Check warning on line 2066 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2066
Check warning on line 2070 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2070
Check warning on line 2072 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2072
Check warning on line 2076 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2075-L2076
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.
once we support renaming dataset entries, this if-statement could break (we still want to update the live-plugin results subscriptions even if the subset name doesn't appear in the data-label anymore).
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.
Alright, I can refactor this slightly then. I think it's simple to do.
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 this could be stored in multiple traitlets and not only aperture. Since the information we need is stored, let's just use 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.
Is it possible for something to be subscribed to multiple subsets, e.g. one spatial and one spectral? If so we shouldn't just blindly replace these entries with the new label.
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.
ah, yes, of course, we also need logic to check if
results_dict[key]
was originallyold_label
Check warning on line 2090 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2079-L2090
Check warning on line 2094 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2092-L2094
Check warning on line 2096 in jdaviz/app.py
Codecov / codecov/patch
jdaviz/app.py#L2096
Check warning on line 864 in jdaviz/configs/default/plugins/subset_tools/subset_tools.py
Codecov / codecov/patch
jdaviz/configs/default/plugins/subset_tools/subset_tools.py#L863-L864
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.
Is this more performant or just a shortcut (in which case I'm not sure if its worth the extra code and test-coverage or not, but don't have a strong opinion)?
Just a note to future selves: eventually we likely will want to migrate this logic into the subset dropdown itself (so these would become
subset_tools.subset.rename...
) since we're planning to use an editable select component, but I think it still makes sense to expose methods at the top-level in this plugin for convenience, so we can always just move the logic there and then have these methods call that instead.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 was just a shortcut that I thought would be useful once we hook it up to the front end, for the case you called out.
Check warning on line 877 in jdaviz/configs/default/plugins/subset_tools/subset_tools.py
Codecov / codecov/patch
jdaviz/configs/default/plugins/subset_tools/subset_tools.py#L877
Check warning on line 880 in jdaviz/configs/default/plugins/subset_tools/subset_tools.py
Codecov / codecov/patch
jdaviz/configs/default/plugins/subset_tools/subset_tools.py#L880
Check warning on line 166 in jdaviz/core/events.py
Codecov / codecov/patch
jdaviz/core/events.py#L166
Check warning on line 170 in jdaviz/core/events.py
Codecov / codecov/patch
jdaviz/core/events.py#L168-L170
Check warning on line 174 in jdaviz/core/events.py
Codecov / codecov/patch
jdaviz/core/events.py#L174
Check warning on line 178 in jdaviz/core/events.py
Codecov / codecov/patch
jdaviz/core/events.py#L178
Check warning on line 182 in jdaviz/core/events.py
Codecov / codecov/patch
jdaviz/core/events.py#L182