diff --git a/.pylintrc b/.pylintrc index ac07e07cc7..7c1aa5fe1b 100644 --- a/.pylintrc +++ b/.pylintrc @@ -63,7 +63,11 @@ disable=missing-docstring, too-many-statements, no-self-use, too-few-public-methods, - bad-continuation + bad-continuation, + import-outside-toplevel, + no-else-continue, + unnecessary-comprehension, + unsubscriptable-object # Enable the message, report, category or checker with the given id(s). You can diff --git a/arviz/tests/helpers.py b/arviz/tests/helpers.py index 58bd8f027b..09e7d3f49c 100644 --- a/arviz/tests/helpers.py +++ b/arviz/tests/helpers.py @@ -1,4 +1,4 @@ -# pylint: disable=redefined-outer-name +# pylint: disable=redefined-outer-name, comparison-with-callable """Test helper functions.""" import gzip import importlib @@ -242,7 +242,7 @@ def emcee_schools_model(data, draws, chains): ndim = J + 2 pos = np.random.normal(size=(chains, ndim)) - pos[:, 1] = np.absolute(pos[:, 1]) + pos[:, 1] = np.absolute(pos[:, 1]) # pylint: disable=unsupported-assignment-operation if emcee_version() < 3: sampler = emcee.EnsembleSampler(chains, ndim, _emcee_lnprob, args=(y, sigma)) diff --git a/arviz/tests/test_diagnostics.py b/arviz/tests/test_diagnostics.py index 3f9062eb7f..1ba514ad5d 100644 --- a/arviz/tests/test_diagnostics.py +++ b/arviz/tests/test_diagnostics.py @@ -174,7 +174,7 @@ def test_rhat(self, data, var_names, method): def test_rhat_nan(self, method): """Confirm R-hat statistic returns nan.""" data = np.random.randn(4, 100) - data[0, 0] = np.nan + data[0, 0] = np.nan # pylint: disable=unsupported-assignment-operation rhat_data = rhat(data, method=method) assert np.isnan(rhat_data) if method == "rank": @@ -552,7 +552,7 @@ def test_mc_error_nan(self, size, ndim): @pytest.mark.parametrize("func", ("_conv_quantile", "_z_scale")) def test_nan_behaviour(self, func): data = np.random.randn(100, 4) - data[0, 0] = np.nan + data[0, 0] = np.nan # pylint: disable=unsupported-assignment-operation if func == "_conv_quantile": assert np.isnan(_conv_quantile(data, 0.5)).all(None) else: diff --git a/arviz/tests/test_stats_utils.py b/arviz/tests/test_stats_utils.py index 206dc09542..7388290987 100644 --- a/arviz/tests/test_stats_utils.py +++ b/arviz/tests/test_stats_utils.py @@ -1,4 +1,5 @@ """Tests for stats_utils.""" +# pylint: disable=no-member import numpy as np from numpy.testing import assert_array_almost_equal import pytest @@ -182,7 +183,7 @@ def test_nan(how): @pytest.mark.parametrize("axis", (-1, 0, 1)) def test_nan_axis(axis): data = np.random.randn(4, 100) - data[0, 0] = np.nan + data[0, 0] = np.nan # pylint: disable=unsupported-assignment-operation axis_ = (len(data.shape) + axis) if axis < 0 else axis assert not_valid(data, check_shape=False, nan_kwargs=dict(how="any")) assert not_valid(data, check_shape=False, nan_kwargs=dict(how="any", axis=axis)).any()