mplhep icon indicating copy to clipboard operation
mplhep copied to clipboard

compatibility issues with matplotlib 3.8.0

Open jpata opened this issue 2 years ago • 6 comments

The latest mplhep 0.3.28 seems incompatible with the latest matplotlib 3.8.0

  File "/home/runner/work/particleflow/particleflow/mlpf/pipeline.py", line 1262, in plots
    import mplhep
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/mplhep/__init__.py", line 10, in <module>
    from . import alice, atlas, cms, label, lhcb, plot
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/mplhep/alice.py", line 5, in <module>
    from matplotlib import docstring
ImportError: cannot import name 'docstring' from 'matplotlib' (/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/matplotlib/__init__.py)

jpata avatar Sep 15 '23 10:09 jpata

same issue here

fred-renner avatar Sep 15 '23 11:09 fred-renner

For anyone coming across this issue, for now, just restrict matplotlib below 3.8, i.e. "matplotlib<3.8"

Addressing this in #442 , solves it temporarily, but we should have a long-term solution. @andrzejnovak maybe?

jonas-eschle avatar Sep 15 '23 13:09 jonas-eschle

Looks like this interface was made internal and deprecated some time ago: https://matplotlib.org/stable/api/docstring_api.html#matplotlib-docstring

lgray avatar Sep 16 '23 19:09 lgray

If you're willing to depend on an internal interface the fix is easy. @andrzejnovak

lgray avatar Sep 16 '23 19:09 lgray

Thanks for reporting everyone. Things should be fixed in 0.3.29 with @lgray's suggestion, but I'll leave this open for now until that's made more permanent.

andrzejnovak avatar Sep 17 '23 07:09 andrzejnovak

matplotlib docs state that "Its use is deprecated and it will be removed in a future version.", so a permanent fix is definitely gonna be required at some point.

ikrommyd avatar Sep 19 '23 15:09 ikrommyd