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

avoid deprecation warning in astropy.time.Time #28

Merged
merged 3 commits into from
May 13, 2024
Merged

Conversation

aelanman
Copy link
Owner

@aelanman aelanman commented May 10, 2024

Assigning to the location attribute will be deprecated in the future. Some logic in lunarsky.time.Time was required to properly handle dimensionless locations (which astropy takes to be EarthLocations), and that required directly setting the location attribute.

This removes the deprecation warning in astropy >= 6.1, while maintaining compatibility with earlier versions.

Closes #27

Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.70%. Comparing base (4be9e04) to head (694f4ca).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #28      +/-   ##
==========================================
+ Coverage   86.64%   86.70%   +0.06%     
==========================================
  Files           7        8       +1     
  Lines         584      617      +33     
==========================================
+ Hits          506      535      +29     
- Misses         78       82       +4     

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

@aelanman aelanman requested a review from bhazelton May 10, 2024 03:18
Copy link
Collaborator

@bhazelton bhazelton left a comment

Choose a reason for hiding this comment

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

Thanks @aelanman, this looks good. I'd just like a small comment in the code to explain what is happening and why.

lunarsky/time.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@bhazelton bhazelton left a comment

Choose a reason for hiding this comment

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

Thanks!

@aelanman aelanman merged commit f5362bc into main May 13, 2024
12 checks passed
@aelanman aelanman deleted the time_loc_warning branch May 13, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New astropy future warning as of astropy 6.1
2 participants