From 550cef73b6e2ce5fbf6ca067132b488dbc412b82 Mon Sep 17 00:00:00 2001 From: "[6~" Date: Wed, 5 Feb 2020 23:42:56 -0600 Subject: [PATCH 1/4] Silence bogus pylint warning --- test/test_step_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_step_matrix.py b/test/test_step_matrix.py index 4f3f965..50a64ea 100755 --- a/test/test_step_matrix.py +++ b/test/test_step_matrix.py @@ -197,7 +197,7 @@ def test_step_matrix_sparse(): sparse=True) assert mat.shape == (3, 3) - assert mat.indices == [(0, 0), (1, 1), (2, 2)] + assert mat.indices == [(0, 0), (1, 1), (2, 2)] # pylint: disable=no-member true_mat = np.eye(3, dtype=np.object) + dt * J assert (mat.data == np.diag(true_mat)).all() -- GitLab From 3ddaa4bb19596f8faa9c53df28331c0fa7ffbfff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Thu, 6 Feb 2020 07:07:35 +0100 Subject: [PATCH 2/4] Add link to pylint bug report for bogus pylint disable --- test/test_step_matrix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_step_matrix.py b/test/test_step_matrix.py index 50a64ea..ff1b5be 100755 --- a/test/test_step_matrix.py +++ b/test/test_step_matrix.py @@ -197,6 +197,7 @@ def test_step_matrix_sparse(): sparse=True) assert mat.shape == (3, 3) + # https://github.com/PyCQA/pylint/issues/3387 assert mat.indices == [(0, 0), (1, 1), (2, 2)] # pylint: disable=no-member true_mat = np.eye(3, dtype=np.object) + dt * J assert (mat.data == np.diag(true_mat)).all() -- GitLab From f2d62d715ff783067751a40b4efdc41dd8248340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Thu, 6 Feb 2020 07:11:31 +0100 Subject: [PATCH 3/4] Remove bogus pylint bug link from test_step_matrix --- test/test_step_matrix.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_step_matrix.py b/test/test_step_matrix.py index ff1b5be..50a64ea 100755 --- a/test/test_step_matrix.py +++ b/test/test_step_matrix.py @@ -197,7 +197,6 @@ def test_step_matrix_sparse(): sparse=True) assert mat.shape == (3, 3) - # https://github.com/PyCQA/pylint/issues/3387 assert mat.indices == [(0, 0), (1, 1), (2, 2)] # pylint: disable=no-member true_mat = np.eye(3, dtype=np.object) + dt * J assert (mat.data == np.diag(true_mat)).all() -- GitLab From 845491a47bcd3254ed50437f618b031bcbec5a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Thu, 6 Feb 2020 07:13:12 +0100 Subject: [PATCH 4/4] Silence bogus not-an-iterable pylint warning (with bug link) --- leap/rk/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/leap/rk/__init__.py b/leap/rk/__init__.py index 0cdb4f3..e11393c 100644 --- a/leap/rk/__init__.py +++ b/leap/rk/__init__.py @@ -770,7 +770,8 @@ class LSRK4MethodBuilder(MethodBuilder): rhs_val = var("rhs_val") with CodeBuilder("primary") as cb: - for a, b, c in self.coeffs: + # https://github.com/PyCQA/pylint/issues/3387 + for a, b, c in self.coeffs: # pylint: disable=not-an-iterable cb(rhs_val, rhs_func(t=t + c*dt, **{comp_id: state})) cb(residual, a*residual + dt*rhs_val) new_state_expr = state + b * residual -- GitLab