Skip to content

Conversation

@sappelhoff
Copy link
Member

@sappelhoff sappelhoff commented Mar 11, 2025

Copy link
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

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

Lots of CI errors of the form:

FAILED mne/beamformer/tests/test_rap_music.py::test_rap_music_simulated - AttributeError: property 'pos' of 'Dipole' object has no setter

Normally how we handle this is to change the previously quasi-public attributes into private ones, e.g., in the class init and throughout the codebase we set Dipole._pos (note the underscore) and use the non-private one when we just need to get the value. If we expect / want users to also be able to set the value of any of these properties (name maybe?) then we would need to add a second public def decorated with @setter, e.g.

@setter
def name(self, name):
    assert isinstance(name, str)  # optional validation, could also use `_validate_type`
    self._name = name

@larsoner larsoner dismissed drammock’s stale review March 12, 2025 13:23

Fixed in latest commits

@larsoner
Copy link
Member

Marking for merge-when-green, thanks in advance @sappelhoff !

@larsoner larsoner enabled auto-merge (squash) March 12, 2025 13:23
@larsoner larsoner merged commit df4a3f1 into mne-tools:main Mar 12, 2025
30 checks passed
@sappelhoff sappelhoff deleted the dipprop branch March 12, 2025 14:34
larsoner added a commit to larsoner/mne-python that referenced this pull request Apr 4, 2025
* upstream/main: (149 commits)
  FIX make_watershed_bem to handle missing talairach_with_skull.lta courtesy Freesurfer 8 (mne-tools#13172)
  ENH: Add upsampling for MEG helmet surface (mne-tools#13179)
  MAINT: Update code credit (mne-tools#13180)
  BUG: Fix bug with least-squares sphere fit (mne-tools#13178)
  fix EDF export (mne-tools#13174)
  fix typo (mne-tools#13171)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13164)
  Fix dev installation guide (mne-tools#13163)
  expose 'mode' for plotting dipole on brain (mne-tools#13162)
  turn dipole attrs into properties (mne-tools#13153)
  remove misformatted (and unused) crossref anchor (mne-tools#13155)
  doc: point to read_dipole (mne-tools#13149)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13152)
  BUG: Fix bug with not short-circuiting n_jobs=1 (mne-tools#13147)
  FIX: Missing coordinates.xml in MFF file (mne-tools#13148)
  FIX: Gracefully handle bad XML files in EGI reader (mne-tools#13145)
  Fixes for Latest IPython (9.0.1) (mne-tools#13146)
  Fix intersphinx (mne-tools#13143)
  BUG: Fix bug with parallel doc build (mne-tools#13140)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#13141)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mne.Dipole attributes not documented in API docs

3 participants