Skip to content

Commit

Permalink
fix logging in filter function
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne committed Feb 27, 2024
1 parent cd736ec commit d29590a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mne_lsl/stream/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from ..utils._checks import check_type, check_value
from ..utils._docs import copy_doc, fill_doc
from ..utils.logs import logger
from ..utils.logs import logger, verbose
from ..utils.meas_info import _HUMAN_UNITS, _set_channel_units

if TYPE_CHECKING:
Expand Down Expand Up @@ -335,6 +335,7 @@ def drop_channels(self, ch_names: Union[str, list[str], tuple[str]]) -> BaseStre
self._pick(picks)
return self

@verbose
@fill_doc
def filter(
self,
Expand All @@ -344,6 +345,8 @@ def filter(
iir_params: Optional[dict[str, Any]] = dict(
order=4, ftype="butter", output="sos"
),
*,
verbose: Optional[Union[bool, str, int]] = None,
) -> BaseStream: # noqa: A003
"""Filter the stream with an IIR causal filter.
Expand Down Expand Up @@ -372,6 +375,7 @@ def filter(
.. note::
The output ``sos`` must be used. The ``ba`` output is not supported.
%(verbose)s
Returns
-------
Expand All @@ -396,7 +400,7 @@ def filter(
del iir_params[key]
iir_params["output"] = "sos"
# construct an IIR filter
with use_log_level(logger.level): # ensure MNE log is set to the same level
with use_log_level(logger.level if verbose is None else verbose):
iir_params = construct_iir_filter(
iir_params=iir_params,
f_pass=None,
Expand Down

0 comments on commit d29590a

Please sign in to comment.