radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
95 stars 61 forks source link

New version planned soon? #853

Closed olebole closed 1 year ago

olebole commented 1 year ago

The last version of spectral_cube is from 2019, and with the actual version of Astropy (5.2) it doesn't pass all tests. Specifically all test_spectral_smooth tests fail now like:

_________________________ test_spectral_smooth[False] __________________________

data_522_delta = PosixPath('/tmp/pytest-of-debci/pytest-0/test_spectral_smooth_False_0/522_delta.fits')
use_dask = False

    def test_spectral_smooth(data_522_delta, use_dask):

        cube, data = cube_and_raw(data_522_delta, use_dask=use_dask)

        result = cube.spectral_smooth(kernel=convolution.Gaussian1DKernel(1.0), use_memmap=False)

>       np.testing.assert_almost_equal(result[:,0,0].value,
                                       convolution.Gaussian1DKernel(1.0,
                                                                    x_size=5).array,
                                       4)
E       AssertionError: 
E       Arrays are not almost equal to 4 decimals
E       
E       Mismatched elements: 5 / 5 (100%)
E       Max absolute difference: 0.00367648
E       Max relative difference: 0.00913138
E        x: array([0.054 , 0.242 , 0.3989, 0.242 , 0.054 ])
E        y: array([0.0545, 0.2442, 0.4026, 0.2442, 0.0545])

/usr/lib/python3/dist-packages/spectral_cube/tests/test_regrid.py:131: AssertionError

These lines look different in the current "main" branch, so I would assume that they are fixed. If a new version is planned, I would just wait a few weeks; otherwise I would try to dig out the required changes for the Debian package (help appreciated here).

keflavich commented 1 year ago

We have a more recent release version: https://github.com/radio-astro-tools/spectral-cube/releases/tag/v0.6.0

It's on pypi too. Where else do we need to release it to get the right version on debian?

olebole commented 1 year ago

Ooops, that was my fault; I checked just the "releases" and not the tags, also not my own Debian version when I created the issue. Sorry!

The failure on top however really happened with 0.6.0 (this is the version we have in Debian currently), and there were some changes on test_regrid.py since then. The question here is whether this is fixed in the current version, and whether there will be a bugfix release for Astropy 5.2?

keflavich commented 1 year ago

I'll verify tests are passing and expand coverage for a new release here: https://github.com/radio-astro-tools/spectral-cube/pull/854

keflavich commented 1 year ago

closed by #854