From fa6af548db8af66f3c1372df64ce0d38e50dde50 Mon Sep 17 00:00:00 2001 From: Milton Camacho <70858549+miltoncamacho@users.noreply.github.com> Date: Tue, 15 Jul 2025 10:51:58 -0600 Subject: [PATCH 1/4] add kwargs to _warnings.py --- fmriprep/_warnings.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fmriprep/_warnings.py b/fmriprep/_warnings.py index 151b6ca0c..0d63278ec 100644 --- a/fmriprep/_warnings.py +++ b/fmriprep/_warnings.py @@ -29,17 +29,20 @@ _wlog.addHandler(logging.NullHandler()) -def _warn(message, category=None, stacklevel=1, source=None): +def _warn(message, category=None, stacklevel=1, source=None, **kwargs): """Redefine the warning function.""" if category is not None: category = type(category).__name__ category = category.replace('type', 'WARNING') + if kwargs: + logging.getLogger('py.warnings').warning(f'Extra warning kwargs: {kwargs}') + logging.getLogger('py.warnings').warning(f'{category or "WARNING"}: {message}') -def _showwarning(message, category, filename, lineno, file=None, line=None): - _warn(message, category=category) +def _showwarning(message, category, filename, lineno, file=None, line=None, , **kwargs): + _warn(message, category=category, **kwargs) warnings.warn = _warn From 140d57865a2c1acf5e584fae382ec450be67a51c Mon Sep 17 00:00:00 2001 From: Milton Camacho <70858549+miltoncamacho@users.noreply.github.com> Date: Tue, 15 Jul 2025 11:01:15 -0600 Subject: [PATCH 2/4] Update CONTRIBUTORS.md --- .maint/CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.maint/CONTRIBUTORS.md b/.maint/CONTRIBUTORS.md index b2ac6180c..9d24363bc 100644 --- a/.maint/CONTRIBUTORS.md +++ b/.maint/CONTRIBUTORS.md @@ -13,6 +13,7 @@ Before every release, unlisted contributors will be invited again to add their n | Bellec | Pierre | | 0000-0002-9111-0699 | SIMEXP Lab, CRIUGM, University of Montréal, Montréal, Canada | | Benson | Noah C. | | 0000-0002-2365-8265 | Department of Psychology, New York University | | Bhagwat | Nikhil | | 0000-0001-6073-7141 | Montreal Neurological Institute, McGill University | +| Camacho | Milton | | 0000-0002-5379-5076 | Department of Pediadrics, University of Calgary | | Callenberg | Keith | | 0000-0001-7786-9300 | Department of Psychiatry, University of Pittsburgh | | Cieslak | Matthew | | 0000-0002-1931-4734 | Perelman School of Medicine, University of Pennsylvania, PA, USA | | de la Vega | Alejandro | | 0000-0001-9062-3778 | University of Texas at Austin | From e0d3ed9eb14e76531aa03e6cac794f6b7dd6a2fd Mon Sep 17 00:00:00 2001 From: Milton Camacho <70858549+miltoncamacho@users.noreply.github.com> Date: Tue, 15 Jul 2025 11:15:52 -0600 Subject: [PATCH 3/4] typo --- fmriprep/_warnings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmriprep/_warnings.py b/fmriprep/_warnings.py index 0d63278ec..fd5b35ed6 100644 --- a/fmriprep/_warnings.py +++ b/fmriprep/_warnings.py @@ -41,7 +41,7 @@ def _warn(message, category=None, stacklevel=1, source=None, **kwargs): logging.getLogger('py.warnings').warning(f'{category or "WARNING"}: {message}') -def _showwarning(message, category, filename, lineno, file=None, line=None, , **kwargs): +def _showwarning(message, category, filename, lineno, file=None, line=None, **kwargs): _warn(message, category=category, **kwargs) From 68b0709b0751b64a19b80dd14a0dfc2631ec3e39 Mon Sep 17 00:00:00 2001 From: mathiasg Date: Tue, 15 Jul 2025 15:47:14 -0400 Subject: [PATCH 4/4] sty: ruff --- fmriprep/_warnings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmriprep/_warnings.py b/fmriprep/_warnings.py index fd5b35ed6..9b8cdac97 100644 --- a/fmriprep/_warnings.py +++ b/fmriprep/_warnings.py @@ -37,7 +37,7 @@ def _warn(message, category=None, stacklevel=1, source=None, **kwargs): if kwargs: logging.getLogger('py.warnings').warning(f'Extra warning kwargs: {kwargs}') - + logging.getLogger('py.warnings').warning(f'{category or "WARNING"}: {message}')