question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set all types to False in pick_types

See original GitHub issue

Would it make sense to set all arguments in pick_types to False by default? In other words, currently everything is False except for meg. I know where this is coming from, but for people working with EEG, NIRS, or other non-MEG signals, we always have to include meg=False in addition to e.g. eeg=True.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
hoechenbergercommented, May 2, 2020

Updated table based on @cbrnr’s and @agramfort’s comments – hope I copied everything correctly.

Type pick_types() call master behavior proposed new behavior
EEG & MEG pick_types(meg=False, eeg=True) EEG only EEG only
EEG & MEG pick_types() MEG only error
EEG & MEG pick_types(eeg=True) EEG & MEG EEG only
EEG pick_types() Error? error
EEG pick_types(eeg=True) EEG & MEG EEG only
MEG pick_types() MEG only error
MEG pick_types(meg=True) MEG only MEG only
1reaction
cbrnrcommented, May 2, 2020

The next release (0.21) should behave identically to 0.20, but a DeprecationWarning should be raised (something like “The defaults of pick_types will change in the next release. All signal types will be set to False by default (currently, meg=True by default).”).

Release 0.22 should implement the new behavior. Your examples will be:

If you have EEG/MEG:

raw.pick_types(meg=False, eeg=True)  # EEG only, will work as before
raw.pick_types()  # error (no signals picked)
raw.pick_types(eeg=True)  # new option to pick EEG only

If you have EEG:

raw.pick_types()  # error (no signals picked)
raw.pick_types(eeg=True)  # need to select EEG

If you have MEG:

raw.pick_types()  # error (no signals picked)
raw.pick_types(meg=True)  # need to select MEG
Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Utility Types - TypeScript
Constructs a type with all properties of Type set to optional. This utility will return a type that represents all subsets of a...
Read more >
Make PickType and OmitType allow optional properties ...
I get Id and password out of response but back in the schema since properties are automatically decorated with 'ApiProperty' by the plugin....
Read more >
Using 'Pick' in TypeScript to simplify Types and Interfaces
In this post you'll learn how to use Pick in TypeScript to help clean up your codebase and make your type management far...
Read more >
Mapped Types - OpenAPI - A progressive Node.js framework
The PickType() function constructs a new type (class) by picking a set of properties from an input type. For example, suppose we start...
Read more >
Typescript Redux - Typing of initialState with CreateSlice
No, you must declare a type for your initialState . That's how createSlice interprets the actual type of state for the rest of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found