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

orientation: expose create_north_up_east_left/right #3308

Merged
merged 8 commits into from
Nov 25, 2024

Conversation

kecnry
Copy link
Member

@kecnry kecnry commented Nov 19, 2024

Description

This pull request exposes create_north_up_east_left(...) and create_north_up_east_right(...) methods via the public API of the Orientation plugin, along with API hints.

This also renames set_on_create to set_as_orientation in these methods, as it sets them whether or not they are created. This does not however, rename the already public set_on_create within add_orientation(...)

Docs updates: Orientation plugin API docs

API hints:
image

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)?

@kecnry kecnry added this to the 4.1 milestone Nov 19, 2024
@github-actions github-actions bot added imviz plugin Label for plugins common to multiple configurations labels Nov 19, 2024
@kecnry kecnry force-pushed the orientation-preset-methods branch from f9a10ae to 340a75b Compare November 19, 2024 18:21
Comment on lines 61 to 62
* :meth:`create_north_up_east_left`
* :meth:`create_north_up_east_right`
Copy link
Member Author

Choose a reason for hiding this comment

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

should we remove create_ from the method names since these can create AND/OR set?

Copy link
Contributor

Choose a reason for hiding this comment

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

I might vote for set_ rather than create_, since set_ tells you the end result?

Copy link
Member Author

Choose a reason for hiding this comment

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

unless you pass set_as_orientation = False 🤔... but I think I agree that I still prefer that

@kecnry kecnry force-pushed the orientation-preset-methods branch from cd851e4 to 2381f25 Compare November 19, 2024 18:49
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 88.81%. Comparing base (7e5ddfa) to head (2381f25).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...z/configs/imviz/plugins/orientation/orientation.py 63.63% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3308   +/-   ##
=======================================
  Coverage   88.81%   88.81%           
=======================================
  Files         125      125           
  Lines       19030    19041   +11     
=======================================
+ Hits        16901    16911   +10     
- Misses       2129     2130    +1     

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


🚨 Try these New Features:

@kecnry kecnry marked this pull request as ready for review November 19, 2024 19:14
@camipacifici
Copy link
Contributor

Clear, works well for me.

Copy link
Contributor

@bmorris3 bmorris3 left a comment

Choose a reason for hiding this comment

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

This looks great, thanks @kecnry!

"""
template_file = __file__, "orientation.vue"

# defined as traitlet to allow access from UI - leave fixed
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# defined as traitlet to allow access from UI - leave fixed
# defined as traitlet to allow access from UI - leave fixed
# since this name is used to identify WCS-only layers elsewhere in jdaviz.

Copy link
Member Author

Choose a reason for hiding this comment

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

I replaced the comment with: defined as traitlet in addition to global variable above to allow access from UI - leave fixed to give more context. Maybe we should define this in one place and import into others if it is an assumed fixed string, but we can do that later 🤷‍♂️

@kecnry
Copy link
Member Author

kecnry commented Nov 25, 2024

@bmorris3 @camipacifici - I renamed create_north_up_east_left/right to set_north_up_east_left/right and also removed the set_as_orientation option from the public API... I don't see a reason why a user would want to create but not set the orientation and I think it only adds confusion, but if either of you want me to keep it, let me know and I'll revert that change.

@camipacifici
Copy link
Contributor

You are right, I am ok with that.

@kecnry kecnry force-pushed the orientation-preset-methods branch from 725f5c2 to d095af5 Compare November 25, 2024 19:50
@kecnry kecnry force-pushed the orientation-preset-methods branch from d095af5 to 1413e62 Compare November 25, 2024 20:09
@kecnry kecnry merged commit 7f0b3f4 into spacetelescope:main Nov 25, 2024
17 checks passed
@kecnry kecnry deleted the orientation-preset-methods branch November 25, 2024 21:54
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 Ready for final review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants