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

Add more units to nasa_exoplanet_archive unit mapper #2218

Merged
merged 4 commits into from
Nov 17, 2021

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented Nov 17, 2021

This should get rid of the unit related warnings that are turned to errors in the test suite.

@rickynilsson - please do double-check whether all of these are correct. E.g. the column definition table (https://exoplanetarchive.ipac.caltech.edu/docs/API_PS_columns.html) uses both log and log10 units are those indeed both base 10 logs? There is some disagreement with the table that is returned, as e.g. for column st_logg the returned unit is 'log(cm/s**2)' while in the definition table it's 'log10(cm/s**2)'. OTOH st_lum is 'log(Solar)' at both places.

I've also slightly modified the warning which may result in more warnings for users (as previously it was one per unit, but now there will be one for each column that has unrecognised units, even if that unit is the same for multiple columns. However, printing the column out helps a lot during debugging to find the column description on the definition page).

@codecov
Copy link

codecov bot commented Nov 17, 2021

Codecov Report

Merging #2218 (0bc3021) into main (1b241d5) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2218   +/-   ##
=======================================
  Coverage   61.80%   61.80%           
=======================================
  Files         129      129           
  Lines       16286    16286           
=======================================
  Hits        10065    10065           
  Misses       6221     6221           
Impacted Files Coverage Δ
...roquery/ipac/nexsci/nasa_exoplanet_archive/core.py 68.87% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b241d5...0bc3021. Read the comment docs.

@bsipocz bsipocz force-pushed the nasa_exoplanet_archive_fix_units branch from 6d58a42 to 0bc3021 Compare November 17, 2021 06:30
@rickynilsson
Copy link
Contributor

rickynilsson commented Nov 17, 2021

This should get rid of the unit related warnings that are turned to errors in the test suite.

@rickynilsson - please do double-check whether all of these are correct. E.g. the column definition table (https://exoplanetarchive.ipac.caltech.edu/docs/API_PS_columns.html) uses both log and log10 units are those indeed both base 10 logs? There is some disagreement with the table that is returned, as e.g. for column st_logg the returned unit is 'log(cm/s**2)' while in the definition table it's 'log10(cm/s**2)'. OTOH st_lum is 'log(Solar)' at both places.

@bsipocz - those units should both be base 10 logs. Thanks for noting that. We will relabel to 'log10(Solar)', and should also make sure the returned unit for st_logg is 'log10(cm/s**2)'.

I've also slightly modified the warning which may result in more warnings for users (as previously it was one per unit, but now there will be one for each column that has unrecognised units, even if that unit is the same for multiple columns. However, printing the column out helps a lot during debugging to find the column description on the definition page).

Sounds good to me!

@bsipocz
Copy link
Member Author

bsipocz commented Nov 17, 2021

those units should both be base 10 logs. Thanks for noting that. We will relabel to 'log10(Solar)', and should also make sure the returned unit for st_logg is 'log10(cm/s**2)'.

right now we parse both of those as log10, hopefully, that assumption stays correct for the future, too.

@bsipocz bsipocz modified the milestones: v0.4.5, v0.4.4 Nov 17, 2021
@bsipocz bsipocz merged commit aba77e3 into astropy:main Nov 17, 2021
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.

Units should be parsed in the nasa_exoplanet_archive module
2 participants