tslearn-team / tslearn

The machine learning toolkit for time series analysis in Python
https://tslearn.readthedocs.io
BSD 2-Clause "Simplified" License
2.91k stars 342 forks source link

Compatibility with version 0.16.0 of sphinx-gallery #521

Open YannCabanes opened 4 months ago

YannCabanes commented 4 months ago

Update tslearn's codes to be compatible with the version 0.16.0 and above of the package sphinx-gallery.

The PR https://github.com/tslearn-team/tslearn/pull/518 has been merged to fix the readthedocs continous integration test which was failing on the main branch with the following error message:

/home/docs/checkouts/readthedocs.org/user_builds/tslearn/checkouts/518/docs/user_guide/dtw.rst:: WARNING: image file not readable: ../_images/sphx_glr_plot_dtw_thumb.svg
/home/docs/checkouts/readthedocs.org/user_builds/tslearn/checkouts/518/docs/user_guide/early.rst:66: WARNING: image file not readable: ../_images/sphx_glr_plot_early_classification_002.svg
/home/docs/checkouts/readthedocs.org/user_builds/tslearn/checkouts/518/docs/user_guide/matrix-profile.rst:12: WARNING: image file not readable: ../_images/sphx_glr_plot_distance_and_matrix_profile_001.svg
/home/docs/checkouts/readthedocs.org/user_builds/tslearn/checkouts/518/docs/user_guide/shapelets.rst:30: WARNING: image file not readable: ../_images/sphx_glr_plot_shapelet_locations_001.svg
/home/docs/checkouts/readthedocs.org/user_builds/tslearn/checkouts/518/docs/user_guide/shapelets.rst:58: WARNING: image file not readable: ../_images/sphx_glr_plot_shapelet_distances_001.svg
looking for now-outdated files... none found
pickling environment... failed

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/tslearn/envs/518/lib/python3.8/site-packages/sphinx/cmd/build.py", line 290, in build_main
    app.build(args.force_all, args.filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/tslearn/envs/518/lib/python3.8/site-packages/sphinx/application.py", line 351, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/tslearn/envs/518/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 290, in build_update
    self.build(to_build,
  File "/home/docs/checkouts/readthedocs.org/user_builds/tslearn/envs/518/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 327, in build
    pickle.dump(self.env, f, pickle.HIGHEST_PROTOCOL)
_pickle.PicklingError: Can't pickle <class 'matplotlib_svg_scraper'>: attribute lookup matplotlib_svg_scraper on builtins failed

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/tslearn/envs/518/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 327, in build
    pickle.dump(self.env, f, pickle.HIGHEST_PROTOCOL)
_pickle.PicklingError: Can't pickle <class 'matplotlib_svg_scraper'>: attribute lookup matplotlib_svg_scraper on builtins failed
The full traceback has been saved in /tmp/sphinx-err-psikz0d_.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

To fix this error, the use of the version 0.15.0 of the package sphinx-gallery was forced in the file docs/requirements_rtd.txt.

The current PR #521 aims to make tslearn compatible with version 0.16.0 of sphinx-gallery.

The following links might be useful: