Repository: mne-tools/mne-python

Issue:
*TFR obj data attribute documentation?
The docs for the TFR objects do not specify how to get at the data. Should this not be included in the docstring?

Colleagues of mine have complained to me MNE is "sparsely documented" here :)

@agramfort @palday 


Discussion:
on an AverageTFR ?
https://martinos.org/mne/dev/generated/mne.time_frequency.AverageTFR.html

yes a good docstring would help and also we should document attributes not
just parameters

Yes, and https://martinos.org/mne/dev/generated/mne.time_frequency.EpochsTFR.html#mne.time_frequency.EpochsTFR

I can go about it once the other PRs are merged :)
ok convince a less experienced person to do this change as it's only a
documentation update.

@nbara do you want to do it? Or is it not enough of a challenge? :)
@jona-sassenhagen it's not about the challenge, but I'm afraid my hands are full at the moment, sorry... 
I was giving a thumbs up because a colleague whom I've slowly managed to convince to try MNE has been complaining about the same thing :) 
@sappelhoff maybe you wanna try your hands at this one though?
@jona-sassenhagen, I haven't worked with time frequency data in MNE yet. I wouldn't really know where to start looking up information that should go into the docstring ...
I would say that it should minimally just include that AverageTFR and EpochsTFR have an attribute (data) that includes the data, and the format (which depends on which kind of object it is). There is an Attributes section in the docs, but it does not include that info.
So for the `EpochsTRF` first ... given the code below, you would want a description of 
>'ch_names', 'comment', 'compensation_grade', 'data', 'freqs', 'info', 'method', 'times'

in the docstring, where currently only `'ch_names'` is implemented?

``` python 
In [1]: import mne
In [5]: import numpy as np

In [10]: data = np.random.random((100, 32, 100, 1000))
In [11]: times = np.arange(1000)
In [12]: freqs = np.linspace(1,100,100)
In [16]: info = mne.create_info(32,1000)

In [18]: epochsTFR = mne.time_frequency.EpochsTFR(info, data, times, freqs)

In [19]: dir(epochsTFR)
Out[19]: 
['__abs__',
 '__class__',
 '__contains__',
 '__delattr__',
 '__dict__',
 '__doc__',
 '__format__',
 '__getattribute__',
 '__hash__',
 '__init__',
 '__module__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '__weakref__',
 '_data',
 '_pick_drop_channels',
 '_size',
 'add_channels',
 'apply_baseline',
 'average',
 'ch_names',
 'comment',
 'compensation_grade',
 'copy',
 'crop',
 'data',
 'drop_channels',
 'freqs',
 'info',
 'method',
 'pick_channels',
 'pick_types',
 'preload',
 'save',
 'times']
```
First and foremost `data`, but if you can do a few others, that'd be good too. Refer to the Evoked and Epochs objects. Does that work for you?

Resolving patch:
diff --git a/mne/time_frequency/tfr.py b/mne/time_frequency/tfr.py
--- a/mne/time_frequency/tfr.py
+++ b/mne/time_frequency/tfr.py
@@ -984,8 +984,30 @@ class AverageTFR(_BaseTFR):
 
     Attributes
     ----------
+    info : instance of Info
+        Measurement info.
+
     ch_names : list
         The names of the channels.
+
+    nave : int
+        Number of averaged epochs.
+
+    data : ndarray, shape (n_channels, n_freqs, n_times)
+        The data array.
+
+    times : ndarray, shape (n_times,)
+        The time values in seconds.
+
+    freqs : ndarray, shape (n_freqs,)
+        The frequencies in Hz.
+
+    comment : string
+        Comment on dataset. Can be the condition.
+
+    method : str | None, defaults to None
+        Comment on the method used to compute the data, e.g., morlet wavelet.
+
     """
 
     @verbose
@@ -1897,9 +1919,27 @@ class EpochsTFR(_BaseTFR):
 
     Attributes
     ----------
+    info : instance of Info
+        Measurement info.
+
     ch_names : list
         The names of the channels.
 
+    data : ndarray, shape (n_epochs, n_channels, n_freqs, n_times)
+        The data array.
+
+    times : ndarray, shape (n_times,)
+        The time values in seconds.
+
+    freqs : ndarray, shape (n_freqs,)
+        The frequencies in Hz.
+
+    comment : string
+        Comment on dataset. Can be the condition.
+
+    method : str | None, defaults to None
+        Comment on the method used to compute the data, e.g., morlet wavelet.
+
     Notes
     -----
     .. versionadded:: 0.13.0


Test patch: