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.

Adding an argument `include_tmax` for `.get_data()`

See original GitHub issue

We ran into a failure today in https://github.com/vferat/pycrostates/pull/14 because raw.get_data() was returning one less sample than expected, namely, the tmax sample.

from pathlib import Path

import mne
print (mne.__version__)

directory = Path(mne.datasets.sample.data_path()) / 'MEG' / 'sample'
fname = directory / 'sample_audvis_filt-0-40_raw.fif' 
raw = mne.io.read_raw_fif(fname, preload=True, verbose=False)

print (raw.get_data().shape)
print (raw.get_data(tmin=0, tmax=raw.times[-1]).shape)

OUT:

0.24.0
(376, 41700)
(376, 41699)

Do you consider this to be a bug in the handling of tmax, or should an additional argument be added, include_tmax, like for raw.crop()?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
larsonercommented, Feb 22, 2022

Since we have include_tmax for crop, +1 for adding it here for consistency

0reactions
larsonercommented, Jul 26, 2022

… might also be relevant for TFR objects after https://github.com/mne-tools/mne-python/pull/10945

Read more comments on GitHub >

github_iconTop Results From Across the Web

The useQuery hook - with variables | Lift-off III - Apollo GraphQL
We pass the GET_TRACK query as the hook's first argument, and now the big difference from ... Add the following in the return...
Read more >
flutter passing multiple data with getx - Stack Overflow
Step: 1 : Sending data. Get.to(Second(), arguments: ["First data", "Second data"]);. Step: 2 : Get data From first screen
Read more >
Pass data between destinations - Android Developers
To pass data between destinations, first define the argument by adding it to the destination that receives it by following these steps:.
Read more >
mne.io.Raw — MNE 1.2.2 documentation - MNE-Python
See the logging documentation and mne.verbose() for details. ... Add reference channels to data that consists of all zeros.
Read more >
argparse — Parser for command-line options, arguments and ...
The ArgumentParser.add_argument() method attaches individual argument specifications to the parser. It supports positional arguments, options that accept ...
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