Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Test failures on Debian #1614

Open
olebole opened this issue Feb 17, 2023 · 5 comments
Open

Test failures on Debian #1614

olebole opened this issue Feb 17, 2023 · 5 comments
Labels
good first issue Easy tasks for beginners triaging:support

Comments

@olebole
Copy link
Contributor

olebole commented Feb 17, 2023

This is a forward of Debian#1031451.

馃悶 Problem

The CI tests we do during the build of the Debian poliastro package fail now:

__________ test_maneuver_constructor_raises_error_if_invalid_delta_v ___________

    def test_maneuver_constructor_raises_error_if_invalid_delta_v():
        dv1 = np.zeros(3) * u.km / u.s
        dv2 = np.ones(2) * u.km / u.s  # Incorrect dv
        with pytest.raises(ValueError) as excinfo:
            with warnings.catch_warnings():
                # Different length numpy arrays generate a deprecation warning.
                warnings.simplefilter(
                    "ignore", category=np.VisibleDeprecationWarning
                )
                Maneuver((0 * u.s, dv1), (2 * u.s, dv2))
>       assert "Delta-V must be three dimensions vectors" in excinfo.exconly()
E       AssertionError: assert 'Delta-V must be three dimensions vectors' in 'ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.'
E        +  where 'ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.' = <bound method ExceptionInfo.exconly of <ExceptionInfo ValueError('setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.') tblen=4>>()
E        +    where <bound method ExceptionInfo.exconly of <ExceptionInfo ValueError('setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.') tblen=4>> = <ExceptionInfo ValueError('setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.') tblen=4>.exconly

tests/test_maneuver.py:26: AssertionError
______________________ test_stumpff_functions_above_zero _______________________

    def test_stumpff_functions_above_zero():
        psi = 3.0
        expected_c2 = (1 - cos(psi**0.5)) / psi
        expected_c3 = (psi**0.5 - sin(psi**0.5)) / psi**1.5
    
        assert_equal(c2(psi), expected_c2)
>       assert_equal(c3(psi), expected_c3)
E       AssertionError: 
E       Items are not equal:
E        ACTUAL: 0.143379966939162
E        DESIRED: 0.14337996693916197

tests/test_stumpff.py:22: AssertionError
______________________ test_stumpff_functions_under_zero _______________________

    def test_stumpff_functions_under_zero():
        psi = -3.0
        expected_c2 = (cosh((-psi) ** 0.5) - 1) / (-psi)
        expected_c3 = (sinh((-psi) ** 0.5) - (-psi) ** 0.5) / (-psi) ** 1.5
    
>       assert_equal(c2(psi), expected_c2)
E       AssertionError: 
E       Items are not equal:
E        ACTUAL: 0.6381924800586426
E        DESIRED: 0.6381924800586427

tests/test_stumpff.py:30: AssertionError

While the last two failures are probably easy to fix with an np.testing.assert_almost_equal() or similar, I have no glue about the first one. Do you have an idea?

Versions:

  • poliastro_0.17.0
  • Python 3.11.2
  • astropy 5.2
  • matplotlib 3.6.3
  • numpy 1.24.2
  • numba 0.56.4
  • pandas 1.5.3
  • scipy 1.10.0
  • sympy 1.11

All Python packages (installed as Debian packages; the part after the - is the Debian revision):

appdirs 1.4.4-3
astropy 5.2.1-2
astroquery 0.4.6+dfsg-4
attr 22.2.0-1
beniget 0.4.1-3
brotli 1.0.9-2+b6
bs4 4.11.2-1
certifi 2022.9.24-1
cffi-backend 1.15.1-5+b1
chardet 5.1.0+dfsg-2
charset-normalizer 3.0.1-2
configobj 5.0.8-1
contourpy 1.0.7-1+b1
coverage 6.5.0+dfsg1-2+b1
cryptography 38.0.4-2
cycler 0.11.0-1
dateutil 2.8.2-1
decorator 5.1.1-3
dev 3.11.2-1
distutils 3.11.2-2
docutils 0.19+dfsg-6
erfa 2.0.0.1+ds-3+b1
fastjsonschema 2.16.2-1
fonttools 4.38.0-1+b1
fs 2.4.16-2
gast 0.5.2-2
html5lib 1.1-3
hypothesis 6.67.1-1
idna 3.3-1
importlib-metadata 4.12.0-1
iniconfig 1.1.1-2
jaraco.classes 3.2.1-3
jeepney 0.8.0-3
jsonschema 4.10.3-1
jupyter-core 4.12.0-1
keyring 23.9.3-2
kiwisolver 1.4.4-1+b1
lib2to3 3.11.2-2
llvmlite 0.39.1-2
lxml 4.9.2-1+b1
lz4 4.0.2+dfsg-1+b2
matplotlib 3.6.3-1+b1
mimeparse 1.6.0-3
minimal 3.11.2-1
more-itertools 8.10.0-2
mpmath 1.2.1-2
nbformat 5.5.0-1
numba 0.56.4+dfsg-2
numpy 1:1.24.2-1
packaging 23.0-1
pandas 1.5.3+dfsg-1
pandas-lib 1.5.3+dfsg-1+b1
pbr 5.10.0-2
pil 9.4.0-1.1+b1
pil.imagetk 9.4.0-1.1+b1
pkg-resources 66.1.1-1
plotly 5.4.1+dfsg-1
pluggy 1.0.0+repack-1
ply 3.11-5
psutil 5.9.4-1+b1
py 1.11.0-1
pyparsing 3.0.9-1
pyrsistent 0.18.1-1+b3
pytest 7.2.1-2
pytest-arraydiff 0.5.0-2
pytest-astropy 0.10.0-2
pytest-astropy-header 0.2.2-1
pytest-cov 4.0.0-1
pytest-doctestplus 0.12.1-1
pytest-filter-subpackage 0.1.2-1
pytest-mock 3.8.2-3
pytest-openfiles 0.5.0-3
pytest-remotedata 0.4.0-1
pythran 0.11.0+ds-7
pyvo 1.2.1-1
requests 2.28.1+dfsg-1
roman 3.3-3
scipy 1.10.0-9
secretstorage 3.3.3-1
setuptools 66.1.1-1
six 1.16.0-4
sortedcontainers 2.4.0-2
soupsieve 2.3.2-1
sympy 1.11.1-1
tenacity 8.0.1-1
tk 3.11.2-2
tomli 2.0.1-2
tomli-w 1.0.0-2
traitlets 5.5.0-1
tz 2022.7.1-1
ufolib2 0.14.0+dfsg1-1
urllib3 1.26.12-1
webencodings 0.5.1-5
yaml 6.0-3+b2
zipp 1.0.0-6
@jorgepiloto
Copy link
Member

Hi @olebole, thank you for forwarding this issue.

I tested all previous conditions except the Python 3.11 (Python 3.10 in my case) and the test passed. Right now, poliastro does not support 3.11 yet since it depends on Numba but no wheels for this py311 have been released, see issue numba/numba#8304

@olebole
Copy link
Contributor Author

olebole commented Feb 22, 2023

I should have read the full error and the meaning of the test ... Actually the error message seems somehow similar to what it should be, and a ValueError is raised. So, I would take this as a minor problem and for the Debian package just mark the first test xfail and change the two others to almost_equal. This keeps poliastro in the game for the next Debian "Bookworm" release.

@jorgepiloto
Copy link
Member

About the assertions, we should impose absolute and relative tolerances via the numpy.testing.assert_allclose function.

@jorgepiloto jorgepiloto added the good first issue Easy tasks for beginners label Feb 22, 2023
@esc
Copy link

esc commented Feb 23, 2023

Hi, Numba dev here, Numba 0.56.4 isn't compatible with Numpy 1.24.* -- see also: https://numba.readthedocs.io/en/stable/user/installing.html#version-support-information

@jorgepiloto
Copy link
Member

Thanks a lot for pointing this out, @esc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy tasks for beginners triaging:support
Projects
None yet
Development

No branches or pull requests

3 participants