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

Update footprint orientations on viewer rotation #2918

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

bmorris3
Copy link
Contributor

When the Orientation plugin changes reference data to rotate a viewer, the footprint method that's currently used to update each of the footprints' properties tries to act on the selected overlay only, not all overlays.

This PR makes a separate method that gets triggered by changes in reference data, and explicitly calls the relevant method (_change_overlay) on each overlay.

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. Bugfix milestone also needs an accompanying backport label.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@github-actions github-actions bot added imviz plugin Label for plugins common to multiple configurations labels Jun 17, 2024
@bmorris3 bmorris3 added this to the 3.10.3 milestone Jun 17, 2024
@@ -451,7 +455,7 @@ def overlay_regions(self):
Access the regions objects corresponding to the current settings
"""

callable_kwargs = {k: getattr(self, k)
callable_kwargs = {k: float(getattr(self, k))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found some cases where the traitlet for PA was being interpreted as a string, which causes problems when a float PA offset is subtracted. Here I ensure we're only giving these properties as floats.

Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.77%. Comparing base (e0b1ec3) to head (fd3f2da).
Report is 149 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2918      +/-   ##
==========================================
+ Coverage   88.76%   88.77%   +0.01%     
==========================================
  Files         111      111              
  Lines       17178    17181       +3     
==========================================
+ Hits        15248    15253       +5     
+ Misses       1930     1928       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmorris3 bmorris3 force-pushed the fix-footprint-on-rotation branch from ffb4a45 to fd3f2da Compare June 18, 2024 18:31
@bmorris3 bmorris3 marked this pull request as ready for review June 18, 2024 18:32
@camipacifici
Copy link
Contributor

Works!! Thank you!!
As a follow up, can we have a spinner in the orientation plugin when it rotates to a new angle? It takes a little bit and the user might feel like clicking again.

Copy link
Contributor

@gibsongreen gibsongreen left a comment

Choose a reason for hiding this comment

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

Love the small diff and I had thought a lot about how to write this test, took some time to go through it, fan of the creative logic, and everything looks good to me!

@bmorris3 bmorris3 merged commit 55e6f6a into spacetelescope:main Jun 19, 2024
19 checks passed
bmorris3 added a commit to bmorris3/jdaviz that referenced this pull request Jul 18, 2024
bmorris3 added a commit to bmorris3/jdaviz that referenced this pull request Jul 18, 2024
bmorris3 added a commit to bmorris3/jdaviz that referenced this pull request Jul 18, 2024
@pllim pllim added the 💤backport-v3.10.x on-merge: backport to v3.10.x label Jul 18, 2024
bmorris3 added a commit that referenced this pull request Jul 19, 2024
Backport PR #2918: Update footprint orientations on viewer rotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imviz plugin Label for plugins common to multiple configurations 💤backport-v3.10.x on-merge: backport to v3.10.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants