Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Fix link #59

Merged
merged 11 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
include:
- os: macos-latest
kind: conda
python: '3.8'
python: '3.9'
env:
CI_OS_NAME: ${{ matrix.os }}
defaults:
Expand Down
35 changes: 34 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import sphinx
import sphinx_gallery # noqa
from docutils import nodes
from sphinx_gallery.sorting import FileNameSortKey
from numpydoc import docscrape
import mne # noqa
Expand Down Expand Up @@ -326,7 +327,7 @@ def reset_warnings(gallery_conf, fname):
'abort_on_example_error': False,
'reset_modules': ('matplotlib', Resetter()), # called w/each script
'image_scrapers': scrapers,
'show_memory': True,
'show_memory': sys.platform.startswith("linux"),
'line_numbers': False, # XXX currently (0.3.dev0) messes with style
'within_subsection_order': FileNameSortKey,
'junit': op.join('..', 'test-results', 'sphinx-gallery', 'junit.xml'),
Expand Down Expand Up @@ -356,6 +357,7 @@ def reset_warnings(gallery_conf, fname):
'ConductorModel': 'mne.bem.ConductorModel',
'EpochsSpectrum': 'mne.time_frequency.EpochsSpectrum',
'EpochsArray': 'mne.EpochsArray',
'SourceEstimate': 'mne.SourceEstimate',
# mne_realtime
'RtEpochs': 'mne_realtime.RtEpochs',
}
Expand All @@ -370,3 +372,34 @@ def reset_warnings(gallery_conf, fname):
# unlinkable
'mne_qt_browser.figure.MNEQtBrowser',
}

# Adapted from MNE-Python

def unit_role(name, rawtext, text, lineno, inliner, options={}, content=[]): # noqa: B006
parts = text.split()

def pass_error_to_sphinx(rawtext, text, lineno, inliner):
msg = inliner.reporter.error(
"The :unit: role requires a space-separated number and unit; "
f"got {text}",
line=lineno,
)
prb = inliner.problematic(rawtext, rawtext, msg)
return [prb], [msg]

# ensure only two parts
if len(parts) != 2:
return pass_error_to_sphinx(rawtext, text, lineno, inliner)
# ensure first part is a number
try:
_ = float(parts[0])
except ValueError:
return pass_error_to_sphinx(rawtext, text, lineno, inliner)
# input is well-formatted: proceed
node = nodes.Text("\u202F".join(parts))
return [node], []


def setup(app):
app.add_role("unit", unit_role)
return
3 changes: 3 additions & 0 deletions mne_realtime/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def pytest_configure(config):
ignore:.*distutils Version classes are deprecated.*:
ignore:`np.MachAr` is deprecated.*:DeprecationWarning
ignore:mne\.io\.pick\..* is deprecated.*:FutureWarning
ignore:The current default of copy=False will change.*:FutureWarning
ignore:MNE-realtime is discontinued in favor of.*:FutureWarning
ignore:unclosed .*:ResourceWarning
""" # noqa: E501
for warning_line in warning_lines.split('\n'):
warning_line = warning_line.strip()
Expand Down
2 changes: 1 addition & 1 deletion mne_realtime/epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def __next__(self, return_event_id=False, verbose=None):

@verbose
def _get_data(self, out=True, picks=None, item=None, *, units=None,
tmin=None, tmax=None, verbose=None):
tmin=None, tmax=None, copy=True, verbose=None):
if not out:
return
unused = dict(tmin=tmin, units=units, tmax=tmax)
Expand Down
Loading