ljvmiranda921 / pyswarms

A research toolkit for particle swarm optimization in Python
https://pyswarms.readthedocs.io/en/latest/
MIT License
1.29k stars 332 forks source link

Tests fail with Matplotlib 3.7 #508

Closed QuLogic closed 1 year ago

QuLogic commented 1 year ago

Describe the bug When using Matplotlib 3.7, tests fail to collect due to using private API:

____________ ERROR collecting tests/utils/plotters/test_plotters.py ____________
ImportError while importing test module '/builddir/build/BUILD/pyswarms-1.3.0/tests/utils/plotters/test_plotters.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/utils/plotters/test_plotters.py:17: in <module>
    from matplotlib.axes._subplots import SubplotBase
E   ModuleNotFoundError: No module named 'matplotlib.axes._subplots'
------------------------------- Captured stdout --------------------------------
No display found. Using non-interactive Agg backend.

To Reproduce Steps to reproduce the behavior:

  1. Install pyswarms, its dependencies and Matplotlib 3.7.
  2. Run pysarms tests.

Expected behavior Tests pass.

Environment (please complete the following information):