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

Fixed matplotlib is required #335

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

kazuki
Copy link
Contributor

@kazuki kazuki commented Sep 20, 2024

matplotlib is an optional dependency, but it is a required dependency as follows.

$  python -c "import specparam"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "*/python3.12/site-packages/specparam/__init__.py", line 6, in <module>
    from .objs import SpectralModel, SpectralGroupModel, SpectralTimeModel, SpectralTimeEventModel
  File "*/python3.12/site-packages/specparam/objs/__init__.py", line 3, in <module>
    from .model import SpectralModel
  File "*/python3.12/site-packages/specparam/objs/model.py", line 10, in <module>
    from specparam.objs.base import BaseObject
  File "*/python3.12/site-packages/specparam/objs/base.py", line 14, in <module>
    from specparam.objs.results import BaseResults, BaseResults2D, BaseResults2DT, BaseResults3D
  File "*/python3.12/site-packages/specparam/objs/results.py", line 14, in <module>
    from specparam.data.conversions import group_to_dict, event_group_to_dict
  File "*/python3.12/site-packages/specparam/data/conversions.py", line 9, in <module>
    from specparam.analysis.periodic import get_band_peak_arr
  File "*/python3.12/site-packages/specparam/analysis/__init__.py", line 3, in <module>
    from .error import compute_pointwise_error, compute_pointwise_error_group
  File "*/python3.12/site-packages/specparam/analysis/error.py", line 6, in <module>
    from specparam.plts.error import plot_spectral_error
  File "*/python3.12/site-packages/specparam/plts/__init__.py", line 3, in <module>
    from .spectra import plot_spectra, plot_spectrogram
  File "*/python3.12/site-packages/specparam/plts/spectra.py", line 14, in <module>
    from specparam.plts.templates import plot_yshade
  File "*/python3.12/site-packages/specparam/plts/templates.py", line 15, in <module>
    from specparam.plts.utils import check_ax, set_alpha
  File "*/python3.12/site-packages/specparam/plts/utils.py", line 18, in <module>
    from specparam.plts.settings import PLT_ALPHA_LEVELS, PLT_ALIASES
  File "*/python3.12/site-packages/specparam/plts/settings.py", line 5, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

@TomDonoghue
Copy link
Member

@kazuki - you are totally right - at some point through development the matplotlib imports in those files you fixed were done inconsistently with the 'optional dependency' status of mpl. Thanks for fixing this - the PR looks good to me, so I'll merge in now!

@TomDonoghue TomDonoghue merged commit bf28787 into fooof-tools:main Sep 23, 2024
6 checks passed
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.

2 participants