Skip to content

Clean up MNE converter temp files and demo code #181

Closed

Description

@suraj-ranganath

🤖 Public MNE conversion helpers create temporary .set paths with delete=False and do not clean the temporary base file or EEGLAB sidecars. The modules also keep inactive demo/test functions with local absolute paths in package code.

Relevant code:

  • src/eegprep/functions/miscfunc/eeg_eeg2mne.py:24 - unmanaged temp path
  • src/eegprep/functions/miscfunc/eeg_mne2eeg.py:57 - unmanaged temp path
  • src/eegprep/functions/miscfunc/eeg_eeg2mne.py:43 - package-local test function
  • src/eegprep/functions/miscfunc/eeg_mne2eeg.py:81 - package-local test function

Acceptance criteria:

  • Converters use a scoped temporary directory and leave no temp artifacts behind.
  • Package modules do not contain demo tests or local machine paths.
  • Tests cover cleanup behavior.

Activity

  1. added
    bug
    on Jun 10, 2026
  2. claude commented on Jun 10, 2026

    @claude
    Contributor

    🤖 Plan:

    • Triage scope (≤100 LOC, self-contained bug fix → PR)
    • Duplicate-work preflight (no open PRs)
    • Replace tempfile.NamedTemporaryFile(delete=False) with tempfile.TemporaryDirectory() in eeg_eeg2mne.py and eeg_mne2eeg.py
    • Drop in-module test_eeg_eeg2mne / test_eeg_mne2eeg demos with macOS-local paths
    • Drop now-unused imports
    • Add cleanup-coverage tests (redirect tempfile.tempdir to a scratch dir; assert empty post-call)
    • ./pre-commit.py --fix + uv run pytest tests/test_eeg_eeg2mne.py tests/test_eeg_mne2eeg.py tests/test_eeg_mne2eeg_epochs.py (33 passed, 9 pre-existing skips)
    • Open PR Scope MNE converter temp files and drop demo helpers #186, monitor CI

    PR: #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions