Skip to content

layout.derivatives['clean'] error #9

Description

@jimzhang629

In preprocess.py, when I use

filt = raw_from_layout(layout.derivatives['clean'], subject=sub,
                           extension='.edf', desc='clean', preload=False) #get line-noise filtered data

I get the following error:

KeyError                                  Traceback (most recent call last)
File [c:\Users\jz421\AppData\Local\anaconda3\envs\ieeg\Lib\site-packages\bids\layout\models.py:742](file:///C:/Users/jz421/AppData/Local/anaconda3/envs/ieeg/Lib/site-packages/bids/layout/models.py:742), in DerivativeDatasets.__getitem__(self, key)
    741 try:
--> 742     result = self.get_pipeline(key)
    743     warnings.warn(
    744         "Directly selecting derivative datasets using "
    745         "pipeline name (i.e. dataset.derivatives[] will be "
   (...)
    749         DeprecationWarning,
    750     )

File [c:\Users\jz421\AppData\Local\anaconda3\envs\ieeg\Lib\site-packages\bids\layout\models.py:773](file:///C:/Users/jz421/AppData/Local/anaconda3/envs/ieeg/Lib/site-packages/bids/layout/models.py:773), in DerivativeDatasets.get_pipeline(self, pipeline)
    772 if not matches:
--> 773     raise KeyError(f"No match found for {pipeline}")
    774 return next(iter(matches))[1]

KeyError: 'No match found for clean'

The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
Cell In[18], line 27
     23 sub = "D0057" #just do one at a time for now, can implement all in a for loop later
     24 print(subjects)
...
    754         f"No datasets found matching {key} either as a pipeline name or as "
    755         "a dataset file name."
    756     ) from err

KeyError: 'No datasets found matching clean either as a pipeline name or as a dataset file name.

I have to use this path to derivatives/clean in order to have the code run successfully:

filt = raw_from_layout(layout.derivatives['derivatives/clean'], subject=sub,
                           extension='.edf', desc='clean', preload=False) #get line-noise filtered data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions