Skip to content

mne.Dipole attributes not documented in API docs #13150

Closed

Description

@sappelhoff

An mne.Dipole object has several attributes like the goodness of fit (gof), see:

mne-python/mne/dipole.py

Lines 134 to 144 in be27cf8

self.pos = np.array(pos)
self.amplitude = np.array(amplitude)
self.ori = np.array(ori)
self.gof = np.array(gof)
self.name = name
self.conf = dict()
if conf is not None:
for key, value in conf.items():
self.conf[key] = np.array(value)
self.khi2 = np.array(khi2) if khi2 is not None else None
self.nfree = np.array(nfree) if nfree is not None else None

However in the API docs, only "times" is documented:


Image


Should sphinx not pick these up automatically?

Activity

  1. drammock commented on Mar 10, 2025

    @drammock
    Member

    Should sphinx not pick these up automatically?

    The reason we only see times is that sphinx only shows things under "Attributes" that were defined with a @property decorator. The Dipole class doesn't have any defined properties itself, but it inherits times from TimeMixin:

    @property
    def times(self):
    """Time vector in seconds."""
    return self._times_readonly

  2. sappelhoff commented on Mar 10, 2025

    @sappelhoff
    MemberAuthor

    Thanks! Do you think we should solve this situation? What would be your approach?

  3. drammock commented on Mar 10, 2025

    @drammock
    Member

    I guess it makes sense to add things like

    @property
    def gof:
        """Goodness-of-fit etc etc."""
        return self.gof

    to the Dipole class def. Not being a heavy dipole user I'm not sure which attributes should be read-only and which should have a @setter

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions