fCWT icon indicating copy to clipboard operation
fCWT copied to clipboard

Fix importing matplotlib whitch is not in pyproject.toml

Open kazuki opened this issue 1 year ago • 1 comments

matplotlib is not in dependencies at pyproject.toml. But importing fCWT raises import error.

$  python -c "import fcwt"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/.../python3.12/site-packages/fcwt/__init__.py", line 2, in <module>
    from .boilerplate import cwt, plot
  File "/.../python3.12/site-packages/fcwt/boilerplate.py", line 3, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

In this PR, I changed the location of matplotlib import from the top level to inside a function. This will ensure that matplotlib is imported only when plot is called.

kazuki avatar Oct 05 '24 11:10 kazuki

resolved the conflict.

kazuki avatar Aug 08 '25 06:08 kazuki