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

Linelists: make lookuptables a little more robust #2901

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

keflavich
Copy link
Contributor

The lookuptables used in linelist searches are a little touchy because of lines like HCO+ and HOCO+. You have to escape the +'s to get them to work, which means that even exact matches to molecules, like 29002 HCO+ v=0,1,2 will not work.

This change means that exact matches will work, while partial matches will still need to be escaped.

Copy link

codecov bot commented Dec 19, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (5600762) 67.23% compared to head (869de3d) 67.23%.
Report is 2 commits behind head on main.

Files Patch % Lines
astroquery/jplspec/lookup_table.py 50.00% 1 Missing ⚠️
astroquery/linelists/cdms/core.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2901      +/-   ##
==========================================
- Coverage   67.23%   67.23%   -0.01%     
==========================================
  Files         235      235              
  Lines       18155    18159       +4     
==========================================
+ Hits        12207    12209       +2     
- Misses       5948     5950       +2     

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

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.

Please add tests for the case you detailed out in the PR description, and maybe a short changelog, too?


"""

if s in self:
Copy link
Member

Choose a reason for hiding this comment

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

ahh, my eyes hurt, could we make this called something longer than s? I suspect that would mean a deprecation--rename?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we renamed it to st in the other instance. But this particular argument is barely user-facing; I don't know that we need to deprecate it

@bsipocz bsipocz added this to the v0.4.7 milestone Dec 19, 2023
@keflavich
Copy link
Contributor Author

This should probably go into a slightly larger refactor too:

  • move jplspec to linelists
  • move the lookup_table function to linelists so cdms & jpl both use the same code

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