Skip to content
This repository has been archived by the owner on Feb 26, 2025. It is now read-only.

test_tree3d fails with Python 3.13 #1130

Closed
penguinpee opened this issue Sep 26, 2024 · 3 comments
Closed

test_tree3d fails with Python 3.13 #1130

penguinpee opened this issue Sep 26, 2024 · 3 comments

Comments

@penguinpee
Copy link

I'm not exactly sure what the root cause of the failure is. But it looks likely to be Python 3.13 (currently 3.13.0rc2), which will be the Python version shipped with Fedora 41 in a few weeks time. With Python 3.12 the same test succeeds.

=================================== FAILURES ===================================
_________________________________ test_tree3d __________________________________
get_fig_3d = (<Figure size 640x480 with 1 Axes>, <Axes3D: >)
    def test_tree3d(get_fig_3d):
        m = load_morphology(SWC_PATH / 'simple.swc')
        fig, ax = get_fig_3d
        tree = m.neurites[0]
        matplotlib_impl.plot_tree3d(tree, ax)
        xy_bounds = ax.xy_dataLim.bounds
        np.testing.assert_allclose(xy_bounds, (-5.0, 0.0, 11.0, 5.0))
        zz_bounds = ax.zz_dataLim.bounds
>       np.testing.assert_allclose(zz_bounds, (0.0, 0.0, 1.0, 1.0))
tests/view/test_matplotlib_impl.py:115: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
args = (<function assert_allclose.<locals>.compare at 0x7f3a8d57ef20>, array([0., 0., 0., 1.]), array([0., 0., 1., 1.]))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-07, atol=0', 'verbose': True}
    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Not equal to tolerance rtol=1e-07, atol=0
E           
E           Mismatched elements: 1 / 4 (25%)
E           Max absolute difference: 1.
E           Max relative difference: 1.
E            x: array([0., 0., 0., 1.])
E            y: array([0., 0., 1., 1.])
/usr/lib64/python3.13/contextlib.py:85: AssertionError
@eleftherioszisis
Copy link
Contributor

Hello! It's due to matplotlib fixing the axes auto-scaling in line collections in 3.9.1.
Could you try if #1131 builds without issues?

@penguinpee
Copy link
Author

Yes, that fixes the failing test. Thank you.

@eleftherioszisis
Copy link
Contributor

NeuroM 4.0.3 should do the trick. Please let me know if you still have issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants