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.

more consistent class instances/types

See original GitHub issue

It is unintuitive and surprising (at least to me and @jasmainak) that:

my_epochs = mne.read_epochs('my_data-epo.fif.gz')
isinstance(my_epochs, mne.Epochs)  # returns False ?!!

It would be nice if mne.epochs.EpochsFIF were a subclass of mne.Epochs so that type checking were more straightforward. Similar argument applies to the various different types of Raw objects. @Eric89GXL has suggested (on Gitter) making _baseEpochs public as one solution, with a caveat in the docstring that it shouldn’t be instantiated directly in user code.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:30 (30 by maintainers)

github_iconTop GitHub Comments

1reaction
jona-sassenhagencommented, Nov 23, 2016

On 23 Nov 2016, at 16:58, Denis A. Engemann notifications@github.com wrote:

I keep being -1000 against .to_epochs method. The way of constructing Epochs is not broken and does not need a fix and is a robust and well working routine. As @agramfort says we don’t need more magic here and it is good force users to know explicitly how they want to construct epochs.

To be fair, the issue of “magic” is orthogonal to the issue of adding a method; the method could in principle be set to require the same input as the current constructor (minus the Raw instance), and we have recently simplified the current constructor to perform some magic.

1reaction
jasmainakcommented, Nov 22, 2016

@drammock let’s not try to overfit and be perfect. Perfect is the enemy of good (and also done) 😃 These things are not obvious when you start a library and it is only apparent in retrospect. We should be a bit more patient before suggesting an overhaul. There are many more urgent things to be done than a class overhaul for a GSoC. I’m sure we can live with minor inconveniences.

Among the suggestions so far, I like my own epochs_types of course – because it has a ring of familiarity and also because it offers a public API without exposing the entire class. But I can also live with making _BaseEpochs public if this is what everyone prefers. Please make a PR if you are up for it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Instance types - Amazon Elastic Compute Cloud
Type Sizes Use case D2 d2.xlarge | d2.2xlarge | d2.4xlarge | d2.8xlarge Storage optimized D3 d3.xlarge | d3.2xlarge | d3.4xlarge | d3.8xlarge Storage optimized DL1 dl1.24xlarge...
Read more >
AWS Instance Types Explained: The Best Time To Use Each
AWS instances are available in a multitude of capabilities. Learn more about each instance type and the best time to use each.
Read more >
Amazon EC2 Instance Types
Amazon EC2 provides a wide selection of instance types optimized to fit different use cases. Instance types comprise varying combinations of CPU, memory, ......
Read more >
Consistent Class and Interface Terminology
Variables of a class type can reference an instance of that class or ... A class that implements one or more interfaces may...
Read more >
AWS EC2 Instance Types: Comparison and Use Cases
Such an application is likely to experience a relatively consistent load most of the time but may see spikes in demand when an...
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