Skip to content

Conversation

@hoechenberger
Copy link
Member

@hoechenberger hoechenberger commented Sep 25, 2022

Fixes #11202

# %%
import numpy as np
import mne

n_seconds = 1
sfreq = 100
ch_names = ['1']
data = np.ones((len(ch_names), sfreq*n_seconds))
info = mne.create_info(ch_names=ch_names, sfreq=sfreq)
raw = mne.io.RawArray(data, info)
raw

main:
Screen Shot 2022-09-25 at 13 43 28

PR:
Screen Shot 2022-09-25 at 13 43 06

I'm don't feel like adding a regression test for this…

@hoechenberger hoechenberger force-pushed the hoechenberger/issue11202 branch from 3025d43 to 005cac7 Compare September 25, 2022 11:42
@hoechenberger hoechenberger marked this pull request as ready for review September 25, 2022 11:44
@hoechenberger hoechenberger requested a review from cbrnr September 25, 2022 11:44
@hoechenberger hoechenberger force-pushed the hoechenberger/issue11202 branch from 005cac7 to ab608eb Compare September 25, 2022 11:47
@hoechenberger hoechenberger added this to the 1.2 milestone Sep 25, 2022
Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

Can factorize the code between repr and repr_html in a private function? Also add a test ? Did you consider using strftime to format the time ?

@hoechenberger hoechenberger changed the title Fix displayed Raw duration in Jupyter notebook MRG: Fix displayed Raw duration in Jupyter notebook Sep 25, 2022
@hoechenberger
Copy link
Member Author

hoechenberger commented Sep 25, 2022

I only wanted to provide a quick and dirty fix here. Repr displays time in seconds, while in HTML we show it in HH:MM:SS (which allowed the bug to sneak in) so this is not directly exchangeable anyway ... any suggestions how to unify this?

@hoechenberger
Copy link
Member Author

CI errors are unrelated

@larsoner
Copy link
Member

I think it's safe enough to unify separately, thanks for the quick fix @hoechenberger !

@larsoner larsoner merged commit 4427adf into mne-tools:main Sep 26, 2022
@hoechenberger hoechenberger deleted the hoechenberger/issue11202 branch September 26, 2022 12:05
larsoner added a commit to drammock/mne-python that referenced this pull request Sep 28, 2022
* upstream/main:
  MAINT: Fix CircleCI error (mne-tools#11205) [circle deploy]
  Add regression-based approach to removing EOG artifacts (mne-tools#11046)
  [DOC, MRG] Minor documentation improvements and remove glossary entry for array-like (mne-tools#11207)
  Fix `include_tmax` not considered in `mne.io.Raw.crop` to check `tmax` in bounds (mne-tools#11204)
  MAINT: Fix notebook backend (mne-tools#11206)
  MRG: Fix displayed Raw duration in Jupyter notebook (mne-tools#11203)
  add EpochsSpectrum.average() (mne-tools#11198)
larsoner added a commit to alexrockhill/mne-python that referenced this pull request Sep 28, 2022
* upstream/main:
  MAINT: Fix CircleCI error (mne-tools#11205) [circle deploy]
  Add regression-based approach to removing EOG artifacts (mne-tools#11046)
  [DOC, MRG] Minor documentation improvements and remove glossary entry for array-like (mne-tools#11207)
  Fix `include_tmax` not considered in `mne.io.Raw.crop` to check `tmax` in bounds (mne-tools#11204)
  MAINT: Fix notebook backend (mne-tools#11206)
  MRG: Fix displayed Raw duration in Jupyter notebook (mne-tools#11203)
  add EpochsSpectrum.average() (mne-tools#11198)
  reduce memory [circle deploy] (mne-tools#11199)
  [BUG, MRG] Fix bug in find_bads_muscle (mne-tools#11197)
  BUG: Fix bug with long legend labels (mne-tools#11181)
larsoner added a commit to drammock/mne-python that referenced this pull request Sep 28, 2022
…-args

* upstream/main:
  Fix mesh display in tutorial (mne-tools#11200)
  MAINT: Add arm64 CI using CirrusCI (mne-tools#11209)
  Fix spatial colors (mne-tools#11201)
  MAINT: Fix CircleCI error (mne-tools#11205) [circle deploy]
  Add regression-based approach to removing EOG artifacts (mne-tools#11046)
  [DOC, MRG] Minor documentation improvements and remove glossary entry for array-like (mne-tools#11207)
  Fix `include_tmax` not considered in `mne.io.Raw.crop` to check `tmax` in bounds (mne-tools#11204)
  MAINT: Fix notebook backend (mne-tools#11206)
  MRG: Fix displayed Raw duration in Jupyter notebook (mne-tools#11203)
  add EpochsSpectrum.average() (mne-tools#11198)
larsoner added a commit to larsoner/mne-python that referenced this pull request Oct 11, 2022
* upstream/main: (64 commits)
  MAINT: Better check (mne-tools#11229)
  MAINT: Fix link and update instantiation note (mne-tools#11228)
  BUG: Add estimated fiducials when missing / assumed head coords (mne-tools#11212)
  Fix tfr db (mne-tools#11223)
  MAINT: Update link (mne-tools#11222)
  add CPGRL doc section (mne-tools#11216)
  Don't insert superfluous newlines in subprocess log messages (mne-tools#11219)
  purge _get_args helper func (mne-tools#11215)
  Standardize topomap args (mne-tools#11123)
  MAINT: Ensure no datasets are downloaded in tests (mne-tools#11213)
  MAINT: Fix Cirrus caching (mne-tools#11211)
  Fix mesh display in tutorial (mne-tools#11200)
  MAINT: Add arm64 CI using CirrusCI (mne-tools#11209)
  Fix spatial colors (mne-tools#11201)
  MAINT: Fix CircleCI error (mne-tools#11205) [circle deploy]
  Add regression-based approach to removing EOG artifacts (mne-tools#11046)
  [DOC, MRG] Minor documentation improvements and remove glossary entry for array-like (mne-tools#11207)
  Fix `include_tmax` not considered in `mne.io.Raw.crop` to check `tmax` in bounds (mne-tools#11204)
  MAINT: Fix notebook backend (mne-tools#11206)
  MRG: Fix displayed Raw duration in Jupyter notebook (mne-tools#11203)
  ...
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.

Incorrect raw duration displayed in HTML repr

3 participants