Skip to content

BUG: Readme example issue with metadata (probably version) #76

@alexrockhill

Description

@alexrockhill
In [1]: import mne
   ...: import mne_rsa
   ...: data_path = mne.datasets.kiloword.data_path(verbose=True)
   ...: epochs = mne.read_epochs(data_path / "kword_metadata-epo.fif")
   ...: # Create model RDMs based on each stimulus property
   ...: columns = epochs.metadata.columns[1:]  # Skip the first column: WORD
   ...: model_rdms = [mne_rsa.compute_rdm(epochs.metadata[col], metric="euclidean") for col in columns]
   ...: # Perform RSA in a sliding window across time
   ...: rsa_results = mne_rsa.rsa_epochs(epochs, model_rdms, temporal_radius=0.01)
   ...: # Plot the result
   ...: mne.viz.plot_compare_evokeds({column: result for column, result in zip(columns, rsa_results)},
   ...:                             picks="rsa", legend="lower center", title="RSA result")
Reading mne_data/MNE-kiloword-data/kword_metadata-epo.fif ...
Isotrak not found
    Found the data of interest:
        t =    -100.00 ...     920.00 ms
        0 CTF compensation matrices available
Adding metadata with 8 columns
960 matching events found
No baseline correction applied
0 projection items activated
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[1], line 6
      4 epochs = mne.read_epochs(data_path / "kword_metadata-epo.fif")
      5 # Create model RDMs based on each stimulus property
----> 6 columns = epochs.metadata.columns[1:]  # Skip the first column: WORD
      7 model_rdms = [mne_rsa.compute_rdm(epochs.metadata[col], metric="euclidean") for col in columns]
      8 # Perform RSA in a sliding window across time

AttributeError: 'list' object has no attribute 'columns'

Looks like there was an update to metadata that didn't make it into the README code snippet:

In [4]: mne.__version__
Out[4]: '1.10.1'
In [5]: mne_rsa.__version__
Out[5]: '1.0-dev'

openjournals/joss-reviews#9148

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