Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts in example folder fail in python 3.12 #171

Open
VikingScientist opened this issue Feb 7, 2024 · 2 comments · Fixed by #173
Open

Scripts in example folder fail in python 3.12 #171

VikingScientist opened this issue Feb 7, 2024 · 2 comments · Fixed by #173
Labels

Comments

@VikingScientist
Copy link
Member

In particular reuleaux.py fails with

/home/kjetijo/Projects/splipy/examples/reuleaux.py:33: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
  plt.show()
Traceback (most recent call last):
  File "/home/kjetijo/Projects/splipy/examples/reuleaux.py", line 46, in <module>
    ax = plt.figure().gca(projection='3d')
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'

and lissajous.py fails with

Traceback (most recent call last):
  File "/home/kjetijo/Projects/splipy/examples/lissajous.py", line 15, in <module>
    from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/usr/lib/python3.12/fractions.py)

and circle_animation.py fails at

/home/kjetijo/Projects/splipy/examples/circle_animation.py:40: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
  plt.show()
/home/kjetijo/venvs/splipy312/lib/python3.12/site-packages/matplotlib/animation.py:892: UserWarning: Animation was deleted without rendering anything. This is most likely not intended. To prevent deletion, assign the Animation to a variable, e.g. `anim`, that exists until you output the Animation using `plt.show()` or `anim.save()`.

Ideally all of these codes (as well as any example codes in the documentation) should be run as part of the CI test suite system.

@TheBB
Copy link
Member

TheBB commented Feb 7, 2024

I have fixed lissajous. The releaux script has more to do with the version of Matplotlib than with Python, but I've fixed that too.

I can't reproduce your circle_animation error, but it looks like you need to make sure you have a better Matplotlib backend installed, or if you have one installed, make sure Matplotlib uses it.

#172

@TheBB
Copy link
Member

TheBB commented Feb 7, 2024

Keeping this open for doctests.

@TheBB TheBB reopened this Feb 7, 2024
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 a pull request may close this issue.

2 participants