Closed eelcodoornbos closed 1 month ago
Hi Eelco,
Thank you for making me aware of this.
Unfortunately, Matplotlib is tightly integrated into Chaosmagpy, so I'm not sure that I can easily turn it into an optional dependency of Chaosmagpy. But I will check and let you know.
As a quick fix, I could replace register_cmap
with matplotlib.cm.register
, which the Matplotlib documentation recommends doing. This also seems to be compatible with earlier versions of Matplotlib.
Hi,
I have just released a minor update of ChaosMagPy where Matplotlib is an optional dependency.
Upon importing ChaosMagPy, it will also try to import Matplotlib. If it is not available, a warning will be issued, but the rest should go through as usual.
Install directly from PyPI:
python -m pip install chaosmagpy==0.13.1
I hope it works as intended. Let me know if you have any issues. Regards
Hi! I'm using chaosmagpy in automatic processing of Swarm data for the space weather timeline viewer. I'm now running into a problem when importing chaosmagpy, where it in turn tries to import a deprecated function from matplotlib.
Of course I could try to install an older matplotlib, but I would prefer not to need to have a specific matplotlib installed for my script, to avoid situations like this. Would it be possible to modify chaosmagpy so that matplotlib is only imported when functions that are using it are called?