-
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
Add API to rename subsets #3356
base: main
Are you sure you want to change the base?
Conversation
e2d811c
to
0e8080a
Compare
A couple thoughts as I move this to Ready for Review:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3356 +/- ##
==========================================
- Coverage 88.12% 87.96% -0.16%
==========================================
Files 127 127
Lines 19574 19667 +93
==========================================
+ Hits 17249 17301 +52
- Misses 2325 2366 +41 ☔ View full report in Codecov by Sentry. |
Noticed a few things (some could be deferred to follow-ups):
|
To add to @kecnry's points, I see the old subset name in Line Analysis under Data. That may be because the data was created with Subset 1, but I'm not sure if we keep the name in that case or go through data created with the old name and update that too. That may be a huge headache though so that can be a follow up effort. |
I was planning to leave data entries created with the old subset name as-is, at least for now. I can add some documentation that that's the case (or we can add that once the UI part of this is done). It might not end up being that bad to implement, but I was worried about potential complexities (for example, if doing a simple find replace in the labels of the data objects, what if you're renaming "Subset 1" but there's also a "Subset 10"?). |
There is an issue though where the automatic updating spectrum returns when the old spectrum is updated, resulting in duplicated entries. Maybe we can defer the renaming of data-entries, but still update entries in |
self.app._rename_subset(old_label, new_label) | ||
self._sync_available_from_state() | ||
|
||
def rename_selected(self, 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.
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.
Besides the points @kecnry brought up and the remaining print statement, this looks good!
12da2c1
to
58eaf12
Compare
7335105
to
4e1a694
Compare
Started from #1291 and #2610, I think I've covered all the points raised in #1539 but I'm still doing a bit more work, so opening as draft.