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 orientation API to match UI #3128

Merged
merged 13 commits into from
Aug 5, 2024

Conversation

rosteen
Copy link
Collaborator

@rosteen rosteen commented Aug 1, 2024

Changes link_type to align_by and wcs_use_affine to fast_approximation to match the text that is in the UI. Opening as draft since I still need to add deprecated versions of the old API.

@rosteen rosteen added imviz plugin Label for plugins common to multiple configurations labels Aug 1, 2024
@rosteen rosteen added this to the 4.0 milestone Aug 1, 2024
@github-actions github-actions bot added documentation Explanation of code and concepts testing labels Aug 1, 2024
@rosteen
Copy link
Collaborator Author

rosteen commented Aug 1, 2024

Added deprecation warnings, note that I left a few things that are only used internally that reference link type (e.g., LinkUpdateMessage). If that seems like it could be confusing I could rename those things as well.

@rosteen rosteen marked this pull request as ready for review August 1, 2024 16:54
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 91.75258% with 8 lines in your changes missing coverage. Please review.

Project coverage is 88.81%. Comparing base (b3bbd9f) to head (19c1bba).
Report is 138 commits behind head on main.

Files with missing lines Patch % Lines
...z/configs/imviz/plugins/orientation/orientation.py 91.66% 4 Missing ⚠️
jdaviz/configs/imviz/helper.py 86.66% 2 Missing ⚠️
jdaviz/configs/default/plugins/markers/markers.py 66.66% 1 Missing ⚠️
jdaviz/core/events.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3128      +/-   ##
==========================================
- Coverage   88.85%   88.81%   -0.04%     
==========================================
  Files         112      112              
  Lines       17409    17430      +21     
==========================================
+ Hits        15468    15481      +13     
- Misses       1941     1949       +8     

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

@pllim pllim added the api API change label Aug 1, 2024
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.

What about concept notebooks?

Idea for April Fool's: On that day, get_alignment_method returns 'chaotic_evil'.

CHANGES.rst Outdated Show resolved Hide resolved

def get_link_type(self, data_label_1, data_label_2):
logging.warning("DeprecationWarning: get_link_type has been replaced by "
Copy link
Contributor

Choose a reason for hiding this comment

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

Why logging.warning instead of normal warnings.warn? Or you can also use the @deprecated decorator from astropy.utils?

This comment applies to all other similar occurrences.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You know, I was just being lazy and copied what the first DeprecationWarning I greped in the repo was doing. I'll update it to use the astropy decorator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated!

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure it is updated? I still see logging.warning in the diff instead of @deprecated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I see the astropy deprecation in the diff. Refresh?

Copy link
Contributor

Choose a reason for hiding this comment

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

I refreshed, but no change. You sure you pushed that commit out?

Screenshot 2024-08-02 153813

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ahh I wasn't paying attention to where this comment was, thought you were talking about the other file and forgot there was one here. One sec...

@rosteen
Copy link
Collaborator Author

rosteen commented Aug 2, 2024

What about concept notebooks?

Good call, I'll update those as well.

@pllim
Copy link
Contributor

pllim commented Aug 2, 2024

CI refused to run, maybe due to conflict. Please rebase. Thanks!

@rosteen rosteen force-pushed the update-orientation-api branch from 1f3011e to e3867e1 Compare August 2, 2024 18:53


@pytest.mark.filterwarnings(r"ignore:The .* function is deprecated")
Copy link
Contributor

Choose a reason for hiding this comment

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

@kecnry , is there a more elegant way to exclude deprecated traitlets from such a test rather than a blanket ignore?

Copy link
Member

Choose a reason for hiding this comment

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

the other option would be an if-statement in the for-loop (if attr in (...): continue). That takes more work to keep updated since individual entries need to be added manually, but also could act as a list of things to remind us to remove them when the deprecation period is over.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hopefully deprecating stuff isn't something we're going to do every day, so should we go the more explicit route?

Copy link
Collaborator Author

@rosteen rosteen Aug 5, 2024

Choose a reason for hiding this comment

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

I made this explicit, there were only two so it wasn't too much.

Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>
jdaviz/app.py Outdated Show resolved Hide resolved
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.

Thanks!

@pllim pllim merged commit f4a6889 into spacetelescope:main Aug 5, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API change documentation Explanation of code and concepts imviz plugin Label for plugins common to multiple configurations Ready for final review testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants