Skip to content

MRG: Revert to using dict subclass for Info - #3147

Merged
agramfort merged 7 commits into
mne-tools:masterfrom
larsoner:fix-info
Apr 20, 2016
Merged

agramfort merged 7 commits into
mne-tools:masterfrom
larsoner:fix-info

Conversation

@larsoner

Copy link
Copy Markdown
Member

Resets us to using dict subclass for Info for 0.12 before we tackle #2860 for 0.13 (or later).

Ready for review/merge from my end.

@larsoner larsoner added this to the 0.12 milestone Apr 20, 2016
@agramfort

Copy link
Copy Markdown
Member

LGTM

@wmvanvliet can you double check?

@coveralls

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 99a4265 on Eric89GXL:fix-info into * on mne-tools:master*.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.002%) to 90.866% when pulling 3dcea85 on Eric89GXL:fix-info into 38db591 on mne-tools:master.

@wmvanvliet

Copy link
Copy Markdown
Contributor

LGTM. +1 for merge.

@larsoner

Copy link
Copy Markdown
Member Author

Thanks for the reviews @agramfort @wmvanvliet. @dengemann you have time to take a look?

Comment thread mne/io/array/array.py
if not isinstance(info, Info):
raise TypeError('info must be an instance of Info, got %s'
% type(info))
info._check_consistency() # make sure it's valid

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Super class _BaseRaw calls it in its constructor shortly thereafter

@agramfort

Copy link
Copy Markdown
Member

otherwise +1 for merge

@agramfort

Copy link
Copy Markdown
Member

@jaeilepp will review tomorrow :)

@dengemann

Copy link
Copy Markdown
Member

Thanks, this looks good. So we have the consistency checking and updating that @wmvanvliet elaborated while keeping things flat. Wonderful! Also +1 from my side.

@agramfort
agramfort merged commit c5a52b4 into mne-tools:master Apr 20, 2016
@agramfort

Copy link
Copy Markdown
Member

great !

@larsoner
larsoner deleted the fix-info branch April 20, 2016 20:50
Comment thread mne/io/kit/kit.py
chan_info['loc'] = np.zeros(12)
chan_info['kind'] = FIFF.FIFFV_STIM_CH
info['chs'].append(chan_info)
info._update_redundant()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be called even if stim is None

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no, it only needs to be called (again) if chs is updated and it's not updated if stim is None

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It already gets called before this earlier by get_kit_info on line 738

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants