mne-tools / mne-connectivity

Connectivity algorithms that leverage the MNE-Python API.
https://mne.tools/mne-connectivity/dev/index.html
BSD 3-Clause "New" or "Revised" License
66 stars 34 forks source link

spectral_connectivity_epochs ignores verbose=False #111

Closed sam-s closed 1 year ago

sam-s commented 1 year ago

Describe the bug

mne_connectivity.spectral_connectivity_epochs(..., verbose=False, n_jobs=-1)

prints

Adding metadata with 3 columns
Connectivity computation...
only using indices for lower-triangular matrix
    computing connectivity for 496 connections
    using t=-1.000s..4.000s for estimation (2501 points)
    computing connectivity for the bands:
     band 1: 1.2Hz..4.0Hz (15 points)
     band 2: 4.2Hz..7.0Hz (15 points)
     band 3: 8.2Hz..12.0Hz (20 points)
     band 4: 12.2Hz..30.0Hz (90 points)
     band 5: 30.2Hz..55.0Hz (125 points)
   ....

Additional information

Platform:         Linux-6.0.6-76060006-generic-x86_64-with-glibc2.35
Python:           3.10.6 (main, Nov  2 2022, 18:53:38) [GCC 11.3.0]
Executable:       /usr/bin/python3
CPU:              x86_64: 8 cores
Memory:           15.3 GB

mne:              1.2.1
numpy:            1.23.4 {OpenBLAS 0.3.20 with 8 threads}
scipy:            1.9.3
matplotlib:       3.6.2 {backend=module://matplotlib_inline.backend_inline}

sklearn:          1.1.3
numba:            Not found
nibabel:          Not found
nilearn:          Not found
dipy:             Not found
openmeeg:         Not found
cupy:             Not found
pandas:           1.5.1
pyvista:          Not found
pyvistaqt:        Not found
ipyvtklink:       Not found
vtk:              Not found
qtpy:             2.3.0 {PyQt5=5.15.3}
ipympl:           Not found
pyqtgraph:        Not found
pooch:            v1.6.0

mne_bids:         Not found
mne_nirs:         Not found
mne_features:     Not found
mne_qt_browser:   Not found
mne_connectivity: 0.4.0
mne_icalabel:     Not found
sam-s commented 1 year ago

Possibly related: https://github.com/mne-tools/mne-python/issues/11321

sam-s commented 1 year ago

workaround: mne.utils.logger.setLevel(30)

adam2392 commented 1 year ago

Hmm.. where is this message "Adding metadata with 3 columns" coming from? I do a ctrl+f in both mne-connectivity and mne-python and do not see it.

sam-s commented 1 year ago

Hmm.. where is this message "Adding metadata with 3 columns" coming from? I do a ctrl+f in both mne-connectivity and mne-python and do not see it.

I spent some time tracking it down and it appears that it is coming from GetEpochsMixin.metadata

But it does not really matter - verbose is ignored in mne-connectivity altogether; it is (apparently) handled in mne by the @verbose annotation but is it missing from mne-connectivity.

larsoner commented 1 year ago

@sam-s if you change the @fill_doc at the top of spectral_connectivity_epochs to @verbose it should fix this problem. Would you be willing to test this and open a PR to fix it?