Repository: mne-tools/mne-python

Issue:
mne.Report.parse_folder doesn't recognize '_meg.fif' files
#### Describe the bug
`Report.parse_folder` wouldn't recognize BIDS-format raw files (`*meg.fif`), altough the documentation example [Getting started with mne.Report](https://mne.tools/dev/auto_tutorials/misc/plot_report.html?highlight=mne%20report) suggests it should.

#### Steps to reproduce
1. Create the raw data object and save it with a filename ending with `meg.fif`
2. Use `Report.parse_folder` to create report for this file
```python
from mne import create_info, Report
from mne.io import RawArray
import numpy as np

n_ch = 5
info = create_info(n_ch, sfreq=200)
data = np.random.randn(n_ch, 1000)
RawArray(data, info).save("test_meg.fif")

report = Report()
report.parse_folder('.', pattern='*meg.fif', render_bem=False)
report.save("report.html")
```

#### Expected results
This is how it looks if I save the raw object as 'test_raw.fif' instead of 'test_meg.fif'

![report_expected](https://user-images.githubusercontent.com/8067672/77247233-1e488f80-6c40-11ea-864e-1d63bf196599.png)

#### Actual results
What I actually get is an empty report.
![report_real](https://user-images.githubusercontent.com/8067672/77247238-29032480-6c40-11ea-8154-f9105cb83b0a.png)

Here's the console output of the script above:
```
In [43]: run test.py
Creating RawArray with float64 data, n_channels=5, n_times=1000
    Range : 0 ... 999 =      0.000 ...     4.995 secs
Ready.
Writing /home/dmalt/Code/python/playground/parse_folder/test_meg.fif
Closing /home/dmalt/Code/python/playground/parse_folder/test_meg.fif [done]
Embedding : jquery.js
Embedding : jquery-ui.min.js
Embedding : bootstrap.min.js
Embedding : jquery-ui.min.css
Embedding : bootstrap.min.css
Iterating over 0 potential files (this may take some time)
Saving report to location /home/dmalt/Code/python/playground/parse_folder/report.html
Rendering : Table of Contents
```

#### Additional information
```
Platform:      Linux-5.3.0-42-generic-x86_64-with-glibc2.10
Python:        3.8.1 (default, Jan  8 2020, 22:29:32)  [GCC 7.3.0]
Executable:    /home/dmalt/.miniconda3/envs/mne_dev/bin/python
CPU:           x86_64: 8 cores
Memory:        Unavailable (requires "psutil" package)
mne:           0.20.dev0
numpy:         1.18.1 {blas=mkl_rt, lapack=mkl_rt}
scipy:         1.4.1
matplotlib:    3.1.3 {backend=Qt5Agg}

sklearn:       Not found
numba:         Not found
nibabel:       Not found
cupy:          Not found
pandas:        Not found
dipy:          Not found
mayavi:        Not found
pyvista:       Not found
vtk:           Not found
```




Discussion:
Looking at the source code at `mne/report.py` suggests it should be an easy fix. I can create a PR for this. I'm not sure though if this is just a documentation problem and you didn't intend to support the BIDS naming for raw files yet.
PR welcome

>


Resolving patch:
diff --git a/mne/report.py b/mne/report.py
--- a/mne/report.py
+++ b/mne/report.py
@@ -40,7 +40,7 @@
                     '-eve.fif', '-eve.fif.gz', '-cov.fif', '-cov.fif.gz',
                     '-trans.fif', '-trans.fif.gz', '-fwd.fif', '-fwd.fif.gz',
                     '-epo.fif', '-epo.fif.gz', '-inv.fif', '-inv.fif.gz',
-                    '-ave.fif', '-ave.fif.gz', 'T1.mgz']
+                    '-ave.fif', '-ave.fif.gz', 'T1.mgz', 'meg.fif']
 SECTION_ORDER = ['raw', 'events', 'epochs', 'evoked', 'covariance', 'trans',
                  'mri', 'forward', 'inverse']
 
@@ -203,7 +203,7 @@ def _get_toc_property(fname):
         tooltip = fname
         text = op.basename(fname)
     elif fname.endswith(('raw.fif', 'raw.fif.gz',
-                         'sss.fif', 'sss.fif.gz')):
+                         'sss.fif', 'sss.fif.gz', 'meg.fif')):
         div_klass = 'raw'
         tooltip = fname
         text = op.basename(fname)
@@ -260,7 +260,7 @@ def _update_html(html, report_fname, report_sectionlabel):
                               fname))
         try:
             if fname.endswith(('raw.fif', 'raw.fif.gz',
-                               'sss.fif', 'sss.fif.gz')):
+                               'sss.fif', 'sss.fif.gz', 'meg.fif')):
                 html = report._render_raw(fname)
                 report_fname = fname
                 report_sectionlabel = 'raw'


Test patch:
diff --git a/mne/tests/test_report.py b/mne/tests/test_report.py
--- a/mne/tests/test_report.py
+++ b/mne/tests/test_report.py
@@ -55,12 +55,14 @@ def test_render_report(renderer, tmpdir):
     """Test rendering -*.fif files for mne report."""
     tempdir = str(tmpdir)
     raw_fname_new = op.join(tempdir, 'temp_raw.fif')
+    raw_fname_new_bids = op.join(tempdir, 'temp_meg.fif')
     ms_fname_new = op.join(tempdir, 'temp_ms_raw.fif')
     event_fname_new = op.join(tempdir, 'temp_raw-eve.fif')
     cov_fname_new = op.join(tempdir, 'temp_raw-cov.fif')
     fwd_fname_new = op.join(tempdir, 'temp_raw-fwd.fif')
     inv_fname_new = op.join(tempdir, 'temp_raw-inv.fif')
     for a, b in [[raw_fname, raw_fname_new],
+                 [raw_fname, raw_fname_new_bids],
                  [ms_fname, ms_fname_new],
                  [event_fname, event_fname_new],
                  [cov_fname, cov_fname_new],