Skip to content

Commit

Permalink
update pylintrc disable rules (#831)
Browse files Browse the repository at this point in the history
* update pylintrc disable rules

* update tests for pylint
  • Loading branch information
ahartikainen committed Sep 26, 2019
1 parent 3bc8ee5 commit 54721b0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions arviz/tests/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=redefined-outer-name
# pylint: disable=redefined-outer-name, comparison-with-callable
"""Test helper functions."""
import gzip
import importlib
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions arviz/tests/test_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion arviz/tests/test_stats_utils.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 54721b0

Please sign in to comment.