Skip to content

Add Report.save(only_if_changed=True) - #14261

Merged
drammock merged 1 commit into
mne-tools:mainfrom
larsoner:report-unsaved-changes
Sep 1, 2026
Merged

Add Report.save(only_if_changed=True)#14261
drammock merged 1 commit into
mne-tools:mainfrom
larsoner:report-unsaved-changes

Conversation

@larsoner

@larsoner larsoner commented Sep 1, 2026

Copy link
Copy Markdown
Member

Sometimes in my scripts reports are opened with a context manager in case I need to add anything, but then in the context manager I don't change anything. It would be nice if MNE-Python was smart enough in that case not to actually write anything out. This PR adds that! Changes drafted with Claude Opus 5 and reviewed by me.

Wasn't 100% sure if report.unsaved_changes should be public or private, but the cost to making it public is low and it seems like it could be useful sometimes. And I figure an explicit only_if_changed=True was a reasonable way to allow people to force a write by passing False if they really want to for some reason.

@drammock
drammock enabled auto-merge (squash) September 1, 2026 15:43
@drammock
drammock merged commit 6ac6a03 into mne-tools:main Sep 1, 2026
31 checks passed
@drammock
drammock deleted the report-unsaved-changes branch September 1, 2026 16:00
larsoner added a commit to larsoner/mne-python that referenced this pull request Sep 2, 2026
* upstream/main: (22 commits)
  Avoid copying all epochs data in GetEpochsMixin._getitem (mne-tools#14262)
  Add Report.save(only_if_changed=True) (mne-tools#14261)
  Add jamica to related software [ci skip] (mne-tools#14260)
  Remove debugging cruft (mne-tools#14259)
  ENH: add Raw annotation span conversion (mne-tools#14240)
  Interactive dipole fitting: add STC mesh controls (mne-tools#14256)
  Document code principles in AGENTS.md (mne-tools#14239)
  MAINT: Update dependency specifiers (mne-tools#14257)
  [dependabot]: Bump the actions group with 2 updates (mne-tools#14258)
  ENH: Add JAMICA as an ICA method (mne-tools#14247)
  Reuse the MEF session across reads (mne-tools#14254)
  Read KIT data in cache-sized blocks (mne-tools#14255)
  Read EGI simple-binary event channels in blocks (mne-tools#14250)
  Decode Persyst and Nihon Kohden data in cache-sized blocks (mne-tools#14251)
  Normalize byte order before calibrating strided integer buffers (mne-tools#14252)
  Speed up EDF and BDF reading (mne-tools#14237)
  ENH: Add Forward-based projection reconstruction (mne-tools#14235)
  Read Artemis123, Curry, EEGLAB, Eximia, FIL and NSx in cache-sized blocks (mne-tools#14246)
  Remove rotating dipoles capability from interactive dipole fitting GUI (mne-tools#14243)
  Read BrainVision data in cache-sized blocks [ci skip] (mne-tools#14241)
  ...
@tsbinns tsbinns mentioned this pull request Sep 3, 2026
larsoner added a commit to natinew77-creator/mne-python that referenced this pull request Sep 3, 2026
* upstream/main: (37 commits)
  Speed up evoked time plotting (mne-tools#14249)
  Persist the numba JIT cache, sysmon coverage, refleak freeze (mne-tools#14265)
  Fix interpolate_to spline target positions (mne-tools#14266)
  CI reduce package builds on pull requests (mne-tools#14264)
  Avoid copying all epochs data in GetEpochsMixin._getitem (mne-tools#14262)
  Add Report.save(only_if_changed=True) (mne-tools#14261)
  Add jamica to related software [ci skip] (mne-tools#14260)
  Remove debugging cruft (mne-tools#14259)
  ENH: add Raw annotation span conversion (mne-tools#14240)
  Interactive dipole fitting: add STC mesh controls (mne-tools#14256)
  Document code principles in AGENTS.md (mne-tools#14239)
  MAINT: Update dependency specifiers (mne-tools#14257)
  [dependabot]: Bump the actions group with 2 updates (mne-tools#14258)
  ENH: Add JAMICA as an ICA method (mne-tools#14247)
  Reuse the MEF session across reads (mne-tools#14254)
  Read KIT data in cache-sized blocks (mne-tools#14255)
  Read EGI simple-binary event channels in blocks (mne-tools#14250)
  Decode Persyst and Nihon Kohden data in cache-sized blocks (mne-tools#14251)
  Normalize byte order before calibrating strided integer buffers (mne-tools#14252)
  Speed up EDF and BDF reading (mne-tools#14237)
  ...
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