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

Remove astroquery.utils.commons.radius_to_unit() #2667

Merged
merged 2 commits into from
Feb 14, 2023

Conversation

eerovaher
Copy link
Member

radius_to_unit(radius, unit) is equivalent to astropy.coordinates.Angle(radius).to_value(unit) except that if unit is not specified then it defaults to degrees. The convenience of not having to specify degrees is not worth obscuring the simple Angle.to_value() call, so this pull request removes the function.

Contributes towards #2429

`radius_to_unit(radius, unit)` was equivalent to
`astropy.coordinates.Angle(radius).to_value(unit)` except that if `unit`
was not specified then it defaulted to degrees. The convenience of not
having to specify degrees was not worth obscuring the simple
`Angle.to_value()` call, so the function has been removed.
@bsipocz bsipocz added this to the v0.4.7 milestone Feb 13, 2023
Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

Looks all good, thanks.
There is one small opportunity for more cleanup, otherwise, this is good to go.

astroquery/esasky/core.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Merging #2667 (87096d2) into main (766a4fc) will increase coverage by 0.00%.
The diff coverage is 70.58%.

@@           Coverage Diff           @@
##             main    #2667   +/-   ##
=======================================
  Coverage   69.17%   69.17%           
=======================================
  Files         304      304           
  Lines       22529    22520    -9     
=======================================
- Hits        15585    15579    -6     
+ Misses       6944     6941    -3     
Impacted Files Coverage Δ
astroquery/esasky/core.py 18.68% <42.85%> (+0.12%) ⬆️
astroquery/vo_conesearch/core.py 41.25% <50.00%> (+1.49%) ⬆️
astroquery/cadc/core.py 81.11% <100.00%> (+0.07%) ⬆️
astroquery/esa/jwst/core.py 75.65% <100.00%> (ø)
astroquery/gaia/core.py 71.08% <100.00%> (ø)
astroquery/utils/commons.py 75.62% <100.00%> (+0.62%) ⬆️
astroquery/cds/core.py 68.75% <0.00%> (-2.09%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

`astropy.units` is now imported as `u` like recommended by `astropy`.
Furthermore, a line tried to use `astropy.io.fits...` despite the module
using `from astropy.io import fits`.
@bsipocz bsipocz merged commit bed438b into astropy:main Feb 14, 2023
@bsipocz
Copy link
Member

bsipocz commented Feb 14, 2023

Thanks @eerovaher!

@eerovaher eerovaher deleted the rm-radius_to_unit branch February 14, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants