Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix importing matplotlib whitch is not in pyproject.toml #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kazuki
Copy link

@kazuki kazuki commented Oct 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant