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

Remove jinja2 and pooch from sys_info #12411

Merged
merged 3 commits into from
Feb 2, 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
10 changes: 8 additions & 2 deletions mne/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,6 @@ def sys_info(
"numpy",
"scipy",
"matplotlib",
"pooch",
"jinja2",
"",
"# Numerical (optional)",
"sklearn",
Expand Down Expand Up @@ -701,6 +699,14 @@ def sys_info(
"sphinx-gallery",
"pydata-sphinx-theme",
"",
"# Infrastructure",
"decorator",
"jinja2",
# "lazy-loader",
"packaging",
"pooch",
"tqdm",
"",
)
try:
unicode = unicode and (sys.stdout.encoding.lower().startswith("utf"))
Expand Down
18 changes: 13 additions & 5 deletions mne/utils/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3298,7 +3298,7 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
difference will be preserved.
"""

docdict["reject_drop_bad"] = """
docdict["reject_drop_bad"] = """\
reject : dict | str | None
Reject epochs based on **maximum** peak-to-peak signal amplitude (PTP)
or custom functions. Peak-to-peak signal amplitude is defined as
Expand All @@ -3320,10 +3320,17 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):

Custom rejection criteria can be also be used by passing a callable,
e.g., to check for 99th percentile of absolute values of any channel
across time being bigger than 1mV. The callable must return a good, reason tuple.
Where good must be bool and reason must be str, list, or tuple where each entry is a str.::

reject = dict(eeg=lambda x: ((np.percentile(np.abs(x), 99, axis=1) > 1e-3).any(), "> 1mV somewhere"))
across time being bigger than :unit:`1 mV`. The callable must return a
``(good, reason)`` tuple: ``good`` must be :class:`bool` and ``reason``
must be :class:`str`, :class:`list`, or :class:`tuple` where each entry
is a :class:`str`::

reject = dict(
eeg=lambda x: (
(np.percentile(np.abs(x), 99, axis=1) > 1e-3).any(),
"signal > 1 mV somewhere",
)
)

.. note:: If rejection is based on a signal **difference**
calculated for each channel separately, applying baseline
Expand All @@ -3332,6 +3339,7 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):

.. note:: If ``reject`` is a callable, than **any** criteria can be
used to reject epochs (including maxima and minima).

If ``reject`` is ``None``, no rejection is performed. If ``'existing'``
(default), then the rejection parameters set at instantiation are used.
""" # noqa: E501
Expand Down
Loading