Skip to content

Conversation

@bloyl
Copy link
Contributor

@bloyl bloyl commented Jul 10, 2020

Closes #7978

@sappelhoff @larsoner @agramfort

I have currently commented out the tests for the complex return type as they don't make sense and thus shouldn't pass.
I could remove them and just leave them as smoke tests or if anyone has a suggestion on what to regression test to I could do that. Just let me know what you think is best.

@drammock I'll admit that I don't know how all the doc linking stuff works so please let me know what needs to be changed.

Copy link
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

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

In addition to my suggested formatting edits, this seems like a good candidate for a docdict entry.

Comment on lines 692 to 694
If False return an EpochsTFR containing separate tfrs for each epoch.
If True return an AverageTFR containing the average of all tfrs across
epochs.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If False return an EpochsTFR containing separate tfrs for each epoch.
If True return an AverageTFR containing the average of all tfrs across
epochs.
If ``False`` return an `EpochsTFR` containing separate TFRs for each
epoch. If ``True`` return an `AverageTFR` containing the average of all
TFRs across epochs.

Comment on lines 696 to 698
.. note:: Using `average=True` is functionally equivlent to using
`average=False` followed by `EpochsTFR.average()`, but will be more
memory efficient.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.. note:: Using `average=True` is functionally equivlent to using
`average=False` followed by `EpochsTFR.average()`, but will be more
memory efficient.
.. note::
Using ``average=True`` is functionally equivalent to using
``average=False`` followed by ``EpochsTFR.average()``, but is
more memory efficient.

Comment on lines 845 to 847
.. note:: Using `average=True` is functionally equivlent to using
`average=False` followed by `EpochsTFR.average()`, but will be more
memory efficient.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.. note:: Using `average=True` is functionally equivlent to using
`average=False` followed by `EpochsTFR.average()`, but will be more
memory efficient.
.. note::
Using ``average=True`` is functionally equivalent to using
``average=False`` followed by ``EpochsTFR.average()``, but is
more memory efficient.

Comment on lines 841 to 843
If False return an EpochsTFR containing separate tfrs for each epoch.
If True return an AverageTFR containing the average of all tfrs across
epochs.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If False return an EpochsTFR containing separate tfrs for each epoch.
If True return an AverageTFR containing the average of all tfrs across
epochs.
If ``False`` return an `EpochsTFR` containing separate TFRs for each
epoch. If ``True`` return an `AverageTFR` containing the average of all
TFRs across epochs.

@sappelhoff
Copy link
Member

Thanks @bloyl the docstring is now much more understandable and clear.

re: test --> I'd either remove it or make it meaningful, but not comment it out and let it sit there.

@drammock I'll admit that I don't know how all the doc linking stuff works so please let me know what needs to be changed.

that works by using this file: https://github.com/mne-tools/mne-python/blob/master/mne/utils/docs.py

see also the explanation that I received some months ago: #7474 (comment)

epochs_power_2 = abs(epochs_power_complex)
epochs_power_3 = epochs_power_2.copy()
epochs_power_3.data[:] = np.inf # test that it's actually copied
assert_array_almost_equal(epochs_power_2.data, epochs_power_picks.data)
Copy link
Member

Choose a reason for hiding this comment

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

Instead of killing these, if they should check the opposite, you could do something like:

assert not np.allclose(..., atol=1-20)

Or whatever makes the point that they actually shouldn't be equal

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.

maybe rebase on master to get more CIs green?

@larsoner larsoner merged commit 18ffbfa into mne-tools:master Jul 13, 2020
@larsoner
Copy link
Member

Thanks @bloyl

larsoner added a commit to larsoner/mne-python that referenced this pull request Jul 14, 2020
* upstream/master: (21 commits)
  MRG: Add SSP projectors to Report (mne-tools#7991)
  BUG: Fix warning (mne-tools#8006)
  WIP: TFR Doc/test changes (mne-tools#7998)
  MAINT: Remove numpydoc test on 3.6 (mne-tools#8005)
  MAINT: Better error message for mismatch (mne-tools#8007)
  MRG: Allow removal of active projectors if channels they applied to have meanwhile been dropped (mne-tools#8003)
  MRG Freesurfer coordinate frame tutorial (mne-tools#7578)
  FIX: Fix stockwell checks (mne-tools#7996)
  MRG, ENH: Add array-spacing plugin and reorganize deps (mne-tools#7997)
  MRG, ENH: Reduce memory usage of Welch PSD (mne-tools#7994)
  STY: One more [ci skip]
  STY: Docstyle [ci skip]
  Report parsing (mne-tools#7990)
  MRG, ENH: BrainVision impedance parsing (mne-tools#7974)
  BUG: Fix missing source space points (mne-tools#7988)
  [MRG] Strip base directory name from Report captions when using parse_folder (mne-tools#7986)
  DOC: Update estimates [skip travis] (mne-tools#7987)
  DOC: Try to improve find_bad_channels_maxwell doc (mne-tools#7982)
  VIZ, BUG: fix tickmarks in evoked topomap colorbar (mne-tools#7980)
  Add low-pass filter to find_bad_channels_maxwell() (mne-tools#7983)
  ...
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.

DOC: order of operation in TFR functions needs to be clarified

5 participants