From 96550fabe5586ee0d0c94b9dfbee822f8cdf2e96 Mon Sep 17 00:00:00 2001 From: arthashworth Date: Fri, 6 Feb 2026 13:07:43 +0000 Subject: [PATCH 1/2] Update linalg.py Remove print outputs from pinv --- src/xarray_einstats/linalg.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/xarray_einstats/linalg.py b/src/xarray_einstats/linalg.py index 8b2821a..2ac0169 100644 --- a/src/xarray_einstats/linalg.py +++ b/src/xarray_einstats/linalg.py @@ -1019,12 +1019,7 @@ def pinv(da, dims=None, *, rcond=None, rtol=None, hermitian=False, **kwargs): if isinstance(rtol, xr.DataArray): da, rtol = xr.broadcast(da, rtol, exclude=set(dims)) pinv_kwargs["rtol"] = rtol - print(da) - print("\n") - print(rcond) - print("\n") - print(rtol) - print("------------------------\n") + return xr.apply_ufunc( np.linalg.pinv, da, From a3c739e568f4c1e38dd2f91eb39f488202e4f480 Mon Sep 17 00:00:00 2001 From: "Oriol (ProDesk)" Date: Tue, 10 Feb 2026 11:53:56 +0100 Subject: [PATCH 2/2] linters and checkers --- .pylintrc | 4 ---- src/xarray_einstats/linalg.py | 2 +- src/xarray_einstats/stats.py | 6 ++---- tests/test_accessors.py | 1 + tests/test_base.py | 1 + tests/test_linalg.py | 1 + tests/test_numba.py | 1 + tests/test_stats.py | 1 + 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.pylintrc b/.pylintrc index 2ad13af..08db7c9 100644 --- a/.pylintrc +++ b/.pylintrc @@ -30,10 +30,6 @@ persistent=yes # Specify a configuration file. #rcfile= -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages -suggestion-mode=yes - # Allow loading of arbitrary C extensions. Extensions are imported into the # active Python interpreter and may run arbitrary code. unsafe-load-any-extension=no diff --git a/src/xarray_einstats/linalg.py b/src/xarray_einstats/linalg.py index 2ac0169..0bead5b 100644 --- a/src/xarray_einstats/linalg.py +++ b/src/xarray_einstats/linalg.py @@ -1019,7 +1019,7 @@ def pinv(da, dims=None, *, rcond=None, rtol=None, hermitian=False, **kwargs): if isinstance(rtol, xr.DataArray): da, rtol = xr.broadcast(da, rtol, exclude=set(dims)) pinv_kwargs["rtol"] = rtol - + return xr.apply_ufunc( np.linalg.pinv, da, diff --git a/src/xarray_einstats/stats.py b/src/xarray_einstats/stats.py index b4f280f..16cf63f 100644 --- a/src/xarray_einstats/stats.py +++ b/src/xarray_einstats/stats.py @@ -346,8 +346,7 @@ def _add_documented_method(cls, wrapped_cls, methods, extra_docs=None): setattr(cls, method_name, method) -doc_extras = { - "rvs": """ +doc_extras = {"rvs": """ Parameters ---------- *args : scalar or array_like or DataArray, optional @@ -372,8 +371,7 @@ def _add_documented_method(cls, wrapped_cls, methods, extra_docs=None): Passed to :func:`xarray.apply_ufunc` **kwargs Passed to the scipy distribution after broadcasting using the same key. -""" -} +"""} base_methods = ["cdf", "logcdf", "sf", "logsf", "ppf", "isf", "rvs"] _add_documented_method(XrRV, "rv_generic", base_methods, doc_extras) _add_documented_method( diff --git a/tests/test_accessors.py b/tests/test_accessors.py index 2556760..f7f097b 100644 --- a/tests/test_accessors.py +++ b/tests/test_accessors.py @@ -1,5 +1,6 @@ # pylint: disable=redefined-outer-name, no-self-use """Test the accessors.""" + from importlib.util import find_spec import numpy as np diff --git a/tests/test_base.py b/tests/test_base.py index be3aac5..54e4c52 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,5 +1,6 @@ # pylint: disable=redefined-outer-name, no-self-use """Test top level functions.""" + import numpy as np import pytest diff --git a/tests/test_linalg.py b/tests/test_linalg.py index 72186d4..f688f5b 100644 --- a/tests/test_linalg.py +++ b/tests/test_linalg.py @@ -1,5 +1,6 @@ # pylint: disable=redefined-outer-name, no-self-use, too-many-public-methods """Test the linalg module.""" + import numpy as np import packaging import pytest diff --git a/tests/test_numba.py b/tests/test_numba.py index 350e791..4804de2 100644 --- a/tests/test_numba.py +++ b/tests/test_numba.py @@ -1,5 +1,6 @@ # pylint: disable=redefined-outer-name, no-self-use """Test the numba module.""" + import numpy as np import pytest diff --git a/tests/test_stats.py b/tests/test_stats.py index 7aaa547..74664ca 100644 --- a/tests/test_stats.py +++ b/tests/test_stats.py @@ -1,5 +1,6 @@ # pylint: disable=redefined-outer-name, no-self-use, too-many-positional-arguments """Test the stats module.""" + import warnings import numpy as np