Skip to content

Conversation

@larsoner
Copy link
Member

@larsoner larsoner commented Oct 30, 2023

cc @hoechenberger I can replicate -- locally the added test passes with n_jobs=1 and fails when n_jobs=2:

mne/utils/tests/test_logging.py:276: in test_verbose_threads
    assert out == want_levels
E   assert [20, 20, 20, 20, 20] == [30, 30, 30, 30, 30]
E     At index 0 diff: 20 != 30
E     Use -v to get more diff

So somehow we need to get the logger.level inside the parallel_func'ed function to persist. Not sure what it'll take but I'll try to look at some point

@larsoner larsoner added this to the 1.6 milestone Oct 30, 2023
@larsoner larsoner modified the milestones: 1.6, 1.7 Nov 7, 2023
@larsoner larsoner modified the milestones: 1.7, 1.6 Nov 7, 2023
@larsoner larsoner marked this pull request as ready for review November 7, 2023 21:43
@larsoner
Copy link
Member Author

larsoner commented Nov 7, 2023

@hoechenberger I can replicate your issue in MNE-BIDS-Pipeline on mne main with:

$ MNE_LOGGING_LEVEL=info pytest mne_bids_pipeline -k ds001810
=============================================================================== test session starts ================================================================================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.0.0 -- /home/larsoner/python/virtualenvs/base/bin/python3
...
┌────────┬ preprocessing/_01_data_quality ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│16:45:45│ ⏳️ sub-01 ses-anodalpost Initializing report HDF5 file
│16:45:45│ ⏳️ sub-01 ses-anodalpre Initializing report HDF5 file
Saving report to : /home/larsoner/mne_data/derivatives/mne-bids-pipeline/ds001810/sub-01/ses-anodalpre/eeg/sub-01_ses-anodalpre_task-attentionalblink_report.h5
Saving report to : /home/larsoner/mne_data/derivatives/mne-bids-pipeline/ds001810/sub-01/ses-anodalpost/eeg/sub-01_ses-anodalpost_task-attentionalblink_report.h5
Embedding : jquery-3.6.0.min.js
Embedding : bootstrap.bundle.min.js
Embedding : bootstrap.min.css
Embedding : bootstrap-table/bootstrap-table.min.js
Embedding : bootstrap-table/bootstrap-table.min.css

And on this PR I get the same thing, as I need to port the change over to MNE-BIDS-Pipeline. But making the change there I get:

$ MNE_LOGGING_LEVEL=info pytest mne_bids_pipeline -k ds001810
=============================================================================== test session starts ================================================================================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.0.0 -- /home/larsoner/python/virtualenvs/base/bin/python3
...
┌────────┬ preprocessing/_01_data_quality ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│16:50:18│ ⏳️ sub-01 ses-anodalpre Adding original raw data to report
│16:50:18│ ⏳️ sub-01 ses-cathodalpost Adding original raw data to report
│16:50:18│ ⏳️ sub-01 ses-anodalpost Adding original raw data to report
│16:50:18│ ⏳️ sub-01 ses-anodaltDCS Adding original raw data to report
...

Copy link
Member

@hoechenberger hoechenberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

@hoechenberger
Copy link
Member

hoechenberger commented Nov 7, 2023

Care to add a changelog entry?

@drammock drammock enabled auto-merge (squash) November 7, 2023 22:01
@drammock drammock merged commit 8d86df6 into mne-tools:main Nov 8, 2023
@drammock drammock deleted the logging branch November 8, 2023 14:58
larsoner added a commit to pablomainar/mne-python that referenced this pull request Nov 8, 2023
* upstream/main:
  BUG: Fix bug with spectrum warning (mne-tools#12186)
  Add argument splash to disable splash-screen from Qt-browser (mne-tools#12185)
  BUG: Fix bug with logging and n_jobs>1 (mne-tools#12154)
  Use gray logo (works in light and dark modes) (mne-tools#12184)
  Tweak logo for dark mode (mne-tools#12176)
  ENH: Improve Covariance.__repr__ (mne-tools#12181)
  ENH: Enable sensor-specific OPM coregistration in mne coreg (mne-tools#11405)
  Tweak README.rst (mne-tools#12166)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#12177)
  MAINT: Add branch coverage (mne-tools#12174)
  OpenSSF (mne-tools#12175)
  fix docstring in 60_sleep.py (mne-tools#12171)
  FIX: skip empty lines in read_raw_eyelink (mne-tools#12172)
  FIX: Fix bug with coreg scalars (mne-tools#12164)
  Changed casting rule in np.clip to allow reading of raw GDF files (mne-tools#12168)
  [DOC] Add documentation for setting montage order (mne-tools#12160)
  Fix inferring fiducials from EEGLAB (mne-tools#12165)
larsoner added a commit to hoechenberger/mne-python that referenced this pull request Nov 8, 2023
…o-pyproject.toml

* upstream/main:
  MAINT: Fix CIs (mne-tools#12188)
  BUG: Fix bug with default alpha and axes (mne-tools#12187)
  BUG: Fix bug with spectrum warning (mne-tools#12186)
  Add argument splash to disable splash-screen from Qt-browser (mne-tools#12185)
  BUG: Fix bug with logging and n_jobs>1 (mne-tools#12154)
  Use gray logo (works in light and dark modes) (mne-tools#12184)
  Tweak logo for dark mode (mne-tools#12176)
  ENH: Improve Covariance.__repr__ (mne-tools#12181)
  ENH: Enable sensor-specific OPM coregistration in mne coreg (mne-tools#11405)
  Tweak README.rst (mne-tools#12166)
snwnde pushed a commit to snwnde/mne-python that referenced this pull request Mar 20, 2024
Co-authored-by: Richard Höchenberger <richard.hoechenberger@gmail.com>
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.

3 participants