Skip to content

Conversation

pllim
Copy link
Member

@pllim pllim commented Mar 18, 2025

Fix #259

Plus some minor clean-ups.

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 89.85507% with 14 lines in your changes missing coverage. Please review.

Project coverage is 87.74%. Comparing base (5e7ea5c) to head (cc8a3e1).
Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
specreduce/conftest.py 92.55% 7 Missing ⚠️
specreduce/fluxcal.py 16.66% 5 Missing ⚠️
specreduce/background.py 90.00% 1 Missing ⚠️
specreduce/wavelength_calibration.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #260      +/-   ##
==========================================
+ Coverage   87.19%   87.74%   +0.54%     
==========================================
  Files          13       15       +2     
  Lines        1179     1289     +110     
==========================================
+ Hits         1028     1131     +103     
- Misses        151      158       +7     

☔ 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 Author

@pllim pllim left a comment

Choose a reason for hiding this comment

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

Hmm devdeps fail for me locally with astropy 7.0.1 but not here using astropy 7.1.dev. So this means something unreleased in astropy is required for specreduce to work with specutils 2.0, which probably means specutils 2.0 cannot be released before either astropy 7.0.2 or 7.1, depending on what PR is involved over at astropy; @rosteen do you remember?

Returns
-------
`~specutils.Spectrum1D` object with same shape as ``image``.
spec : `~specutils.Spectrum1D`
Copy link
Member Author

Choose a reason for hiding this comment

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

The Sphinx ref will have to be updated separately after specutils 2.0 stable is released and RTD picks up specutils 2.0. Might have to do a special requirements file for doc build or pin specutils>=2 here:

docs = [

But nothing we can do right now.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, ignore my other comment, then.

For example:
For example::
>>> standard_sensfunc(obj_wave, obj_flux, stdstar='spec50cal/bd284211.dat', mode='spline') # doctest: +SKIP
Copy link
Member Author

Choose a reason for hiding this comment

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

If there is no intention to run this through doctest, omitting >>> is enough to stop it from being collected by pytest-doctestplus.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, that's a pretty old example that, iirc, dates back to before specreduce-data was split into its own repository. it should definitely be skipped by doctest one way or the other. if omitting >>> is a preferred method, might as well do that here.

@tepickering
Copy link
Contributor

based on all the work required here, i suspect this transition will be painful for a lot of packages that use specutils...

@pllim
Copy link
Member Author

pllim commented Mar 21, 2025

Doh... The devdeps here is specutils: 1.19.1.dev23+g6dcc1ad not the RC. 🤦‍♀️

I see the same failures locally with specutils 2.0 + astropy 7.1.dev , so the compatibility problem remains.

@pllim
Copy link
Member Author

pllim commented Mar 21, 2025

Okay, mystery solved. devdeps here now gives the same traceback as integration testing when I switch dev specutils to install from its 2.0 branch.

pllim and others added 5 commits March 28, 2025 17:18
Co-authored-by: Ricky O'Steen <39831871+rosteen@users.noreply.github.com>
and remove unnecessary style changes
@pllim pllim marked this pull request as ready for review March 28, 2025 21:48
@pllim
Copy link
Member Author

pllim commented Mar 28, 2025

Thanks to @rosteen upstream fix, unless there are more changes upstream, I think this is ready for review.

Copy link
Contributor

@tepickering tepickering left a comment

Choose a reason for hiding this comment

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

thanks for doing all the leg-work to get this compatibility set up. i will most likely borrow some of these tricks for other projects that will need to support both 1.x and 2.x of specutils...

i'm approving, though it'd be nice to fix some of the test coverage that's missing to keep codecov happy. however, it looked like some of what was "missing" should be covered with the right devdeps test. so maybe adding a devdeps-cov job is all that's needed.

@pllim

This comment was marked as resolved.

@hpparvi
Copy link
Contributor

hpparvi commented Apr 5, 2025

Excellent work, @pllim! Do you want me to hold off on merging until you've added the devdeps-cov job?

pllim added 2 commits April 6, 2025 11:01
but be careful what you wish for since devdeps can be unstable
@pllim
Copy link
Member Author

pllim commented Apr 6, 2025

Okay added coverage to devdeps but that job can be unstable so YMMV.

@hpparvi hpparvi merged commit 1f04ce9 into astropy:main Apr 7, 2025
12 checks passed
@hpparvi
Copy link
Contributor

hpparvi commented Apr 7, 2025

Thanks, merged!

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.

Compatibility with specutils 2.0
4 participants