LABSN / mnefun

Facilitating lab integration with mne-python
BSD 3-Clause "New" or "Revised" License
6 stars 15 forks source link

Parser error #320

Closed ktavabi closed 3 years ago

ktavabi commented 3 years ago

@larsoner

   proj_nums: {
     [[1, 1, 0],  # ECG: grad/mag/eeg
      [0, 0, 0],  # EOG
      [1, 1, 0]]
     } 

old fashioned projector lists in my yaml file returned ...

Traceback (most recent call last): File "/home/ktavabi/Github/badbaby/badbaby/processing/mnefun_script.py", line 94, in params = mnefun.read_params('mmn_params.yml') File "/home/ktavabi/Github/mnefun/mnefun/_yaml.py", line 65, in read_params attrs = _flat_params_read(fname) File "/home/ktavabi/Github/mnefun/mnefun/_yaml.py", line 129, in _flat_params_read yvals = yaml.load(fid, Loader=yaml.SafeLoader) File "/home/ktavabi/anaconda3/envs/mne/lib/python3.8/site-packages/yaml/init.py", line 114, in load return loader.get_single_data() File "/home/ktavabi/anaconda3/envs/mne/lib/python3.8/site-packages/yaml/constructor.py", line 49, in get_single_data node = self.get_single_node() File "/home/ktavabi/anaconda3/envs/mne/lib/python3.8/site-packages/yaml/composer.py", line 36, in get_single_node document = self.compose_document() File "/home/ktavabi/anaconda3/envs/mne/lib/python3.8/site-packages/yaml/composer.py", line 55, in compose_document node = self.compose_node(None, None) File "/home/ktavabi/anaconda3/envs/mne/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node node = self.compose_mapping_node(anchor) File "/home/ktavabi/anaconda3/envs/mne/lib/python3.8/site-packages/yaml/composer.py", line 127, in compose_mapping_node while not self.check_event(MappingEndEvent): File "/home/ktavabi/anaconda3/envs/mne/lib/python3.8/site-packages/yaml/parser.py", line 98, in check_event self.current_event = self.state() File "/home/ktavabi/anaconda3/envs/mne/lib/python3.8/site-packages/yaml/parser.py", line 438, in parse_block_mapping_key raise ParserError("while parsing a block mapping", self.marks[-1], yaml.parser.ParserError: while parsing a block mapping in "mmn_params.yml", line 1, column 1 expected , but found '' in "mmn_params.yml", line 50, column 2

ktavabi commented 3 years ago

Update: YAML linted. Still having issues passing legacy proj_nums

larsoner commented 3 years ago

It's closed now, I assume it's working now? I would have thought something like this would have worked:

proj_nums: [[1, 1, 0], [0, 0, 0], [1, 1, 0]]
drammock commented 3 years ago

As Eric implies, the problem in the original post is the curly brackets, they shouldn't be there.

ktavabi commented 3 years ago

Tried both. Different trace back without curlies.


Kambiz Tavabi PhD Research Scientist T: +1 206 685 6173 <+12066856173> M: +1 215 688 1763 <+12156881763> ktavabi@uw.edu Institute for Learning & Brain Sciences 1715 Columbia Road N <x-apple-data-detectors://1> Portage Bay Building <x-apple-data-detectors://1> Box 357988 <x-apple-data-detectors://1> University of Washington Seattle, WA 98195-7988

On February 4, 2021 at 5:24:51 AM, Daniel McCloy (notifications@github.com) wrote:

As Eric implies, the problem in the original post is the curly brackets, they shouldn't be there.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/LABSN/mnefun/issues/320#issuecomment-773300836, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBNU2S7SULRAFSMU3RMRWLS5KN2HANCNFSM4XCCRALA .

drammock commented 3 years ago

weird. I just ran yesterday with something like this in the YAML:

preprocessing:
    ssp:
        proj_nums: [[1, 1, 0],  # ECG: grad/meg/eeg
                    [0, 0, 0],  # EOG  (combined saccade and blink events)
                    [0, 0, 0],  # Continuous (from ERM)
                    [0, 0, 0],  # HEOG (focus on saccades)
                    [0, 0, 0]]  # VEOG  (focus on blinks)
ktavabi commented 3 years ago

I'll try again after Eric merges code bases.