Skip to content

Conversation

@keflavich
Copy link
Contributor

CDMS was moved there, this is the right home for JPLSpec too.

This is the first in a series of PRs to clean up and regularize these modules.

"Please use 'from astroquery.linelists.jplspec import JPLSpec' instead. "
"The old import path will be removed in a future version.",
DeprecationWarning,
stacklevel=2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know if this is necessary or right. I have no experience playing with stacklevels yet.

Copy link
Member

Choose a reason for hiding this comment

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

I can't remember any more why I went with stacklevel 2 for astroquery.irsa, but it worked.

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.

The concept is OK, but you need to fix the tests

CHANGES.rst Outdated
jplspec
^^^^^^^

- Moved to linelists/ [#3455]
Copy link
Member

Choose a reason for hiding this comment

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

We will need a more detailed changelog, as well as to add a new linelists.jplspec entry to mark its creation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, might need to iterate on this once more

"Please use 'from astroquery.linelists.jplspec import JPLSpec' instead. "
"The old import path will be removed in a future version.",
DeprecationWarning,
stacklevel=2
Copy link
Member

Choose a reason for hiding this comment

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

I can't remember any more why I went with stacklevel 2 for astroquery.irsa, but it worked.

Comment on lines 7 to 8
from ...query import BaseQuery
from ...utils import async_to_sync
Copy link
Member

Choose a reason for hiding this comment

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

as you already touch this, use normal imports, we don't need absolute ones, especially not for anything we don't directly test in this particular file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean switch to from astroquery...? (that's an absolute import, right? the from ... is relative?)

Copy link
Member

Choose a reason for hiding this comment

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

yeap. I think we needed this in python2 era (but even then, it could have just stayed relative from the module in the test files and not for everything astroquery), but it's not really an issue any more.

@bsipocz bsipocz added this to the 0.4.12 milestone Nov 12, 2025
@keflavich
Copy link
Contributor Author

non-remote CI is fixed (well, we'll see, but at least locally...). Remote CI can't be so easily repaired as it requires the workaround in #3456, so docs are expected to fail.

@keflavich
Copy link
Contributor Author

ah, oops, I need to not fail for warnings...

_ ERROR collecting .tox/py313-test/lib/python3.13/site-packages/astroquery/jplspec/__init__.py _
../../.tox/py313-test/lib/python3.13/site-packages/astroquery/jplspec/__init__.py:22: in <module>
    warnings.warn(
E   DeprecationWarning: Importing from 'astroquery.jplspec' is deprecated. Please use 'from astroquery.linelists.jplspec import JPLSpec' instead. The old import path will be removed in a future version.

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.69%. Comparing base (e4aaaf5) to head (8140eb7).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/linelists/jplspec/setup_package.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3455   +/-   ##
=======================================
  Coverage   70.68%   70.69%           
=======================================
  Files         232      233    +1     
  Lines       20088    20091    +3     
=======================================
+ Hits        14200    14203    +3     
  Misses       5888     5888           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

All looks good, but needs a rebase for the changelog.

@bsipocz bsipocz merged commit ceb6c1a into astropy:main Nov 19, 2025
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants