Skip to content
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

bugfix for viewer rename when viewer ID is different from reference name #2479

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

bmorris3
Copy link
Contributor

#2338 implemented viewer reference name updates, with an option to update viewer IDs as well. That feature is intended for internal use in lcviz.

Subsequent development in lcviz exposed a bug in the jdaviz method when update_id=True (spacetelescope/lcviz#35). Each viewer's entry in the viewer store has a hidden attr _reference_id which should match viewer_item['id'], but #2338 did not update that attr.

Also, the ID is only updated if update_id=True and viewer_item['id'] == old_reference, but the latter condition is satisfied if the ID matches the reference name (which is not required elsewhere).

This PR adds the missing update to the hidden reference_id attr, and removes the unnecessary second condition for updating the ID.

Change log entry

  • Is a change log needed? If yes, is it added to 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, maintainer
    should 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.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@bmorris3 bmorris3 force-pushed the viewer-rename-bugfix branch from ef68fb1 to 9614aa0 Compare September 22, 2023 14:57
@bmorris3 bmorris3 added this to the 3.7.1 milestone Sep 22, 2023
@bmorris3 bmorris3 added the bug Something isn't working label Sep 22, 2023
@bmorris3
Copy link
Contributor Author

The test failure in this PR is identical to the one that #2478 is intended to fix.

@bmorris3 bmorris3 marked this pull request as ready for review September 22, 2023 16:59
@pllim pllim added the 💤 backport-v3.7.x on-merge: backport to v3.7.x label Sep 22, 2023
CHANGES.rst Outdated Show resolved Hide resolved
CHANGES.rst Outdated Show resolved Hide resolved
@@ -1655,11 +1655,11 @@ def _update_viewer_reference_name(
viewer_item['name'] = new_reference

# optionally update the viewer IDs:
if update_id and viewer_item['id'] == old_reference:
# update the id as well
if update_id:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you added this logic back in #2338 . Why was the == check necessary back then but not anymore?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the original implementation in lcviz had just the == logic without the update_id switch, so I think it just came with that accidentally without thinking about if we still needed it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't necessary then or now, hence the bugfix.

@bmorris3 bmorris3 force-pushed the viewer-rename-bugfix branch from 9614aa0 to a666c43 Compare September 22, 2023 18:33
Copy link
Contributor

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks like code.

Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works locally with spacetelescope/lcviz#35, thanks!!

@kecnry
Copy link
Member

kecnry commented Sep 26, 2023

@bmorris3 - I think this should pass CI once its rebased 🤞

@bmorris3 bmorris3 force-pushed the viewer-rename-bugfix branch from a666c43 to 8f93311 Compare September 26, 2023 17:33
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Files Coverage Δ
jdaviz/app.py 85.18% <50.00%> (-0.09%) ⬇️

📢 Thoughts on this report? Let us know!.

@pllim pllim merged commit 38ef924 into spacetelescope:main Sep 26, 2023
12 of 14 checks passed
@lumberbot-app

This comment was marked as resolved.

@pllim
Copy link
Contributor

pllim commented Sep 26, 2023

Ooof, you will need to manually backport or change the milestone.

bmorris3 added a commit to bmorris3/jdaviz that referenced this pull request Sep 27, 2023
bmorris3 added a commit to bmorris3/jdaviz that referenced this pull request Sep 27, 2023
bmorris3 added a commit to bmorris3/jdaviz that referenced this pull request Sep 27, 2023
bmorris3 added a commit that referenced this pull request Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 💤 backport-v3.7.x on-merge: backport to v3.7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants