From a5c0e8081a495c52dc671e663eaf99a260b81d59 Mon Sep 17 00:00:00 2001 From: Lutfi Randiva Date: Mon, 18 Apr 2022 18:02:43 +0800 Subject: [PATCH 1/4] Removed else-if-used from pylint probnum/problems. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 201abac0e..7d5c93b3e 100644 --- a/tox.ini +++ b/tox.ini @@ -68,7 +68,7 @@ commands = # Per-package Linting Passes pylint src/probnum/diffeq --disable="redefined-outer-name,too-many-instance-attributes,too-many-arguments,too-many-locals,too-few-public-methods,protected-access,unnecessary-pass,unused-variable,unused-argument,no-self-use,duplicate-code,missing-function-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc" --jobs=0 pylint src/probnum/filtsmooth --disable="no-member,arguments-differ,too-many-arguments,too-many-locals,too-few-public-methods,protected-access,unused-variable,unused-argument,no-self-use,duplicate-code,useless-param-doc" --jobs=0 - pylint src/probnum/linalg --disable="no-member,abstract-method,arguments-differ,redefined-builtin,too-many-instance-attributes,too-many-arguments,too-many-locals,too-many-lines,too-many-statements,too-many-branches,too-complex,too-few-public-methods,protected-access,unused-argument,attribute-defined-outside-init,no-else-return,no-else-raise,no-self-use,else-if-used,duplicate-code,missing-module-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc" --jobs=0 + pylint src/probnum/linalg --disable="no-member,abstract-method,arguments-differ,redefined-builtin,too-many-instance-attributes,too-many-arguments,too-many-locals,too-many-lines,too-many-statements,too-many-branches,too-complex,too-few-public-methods,protected-access,unused-argument,attribute-defined-outside-init,no-else-return,no-else-raise,no-self-use,duplicate-code,missing-module-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc" --jobs=0 pylint src/probnum/linops --disable="too-many-instance-attributes,too-many-arguments,too-many-locals,protected-access,no-else-return,no-else-raise,else-if-used,missing-class-docstring,missing-function-docstring,missing-raises-doc,duplicate-code" --jobs=0 pylint src/probnum/problems --disable="too-many-arguments,too-many-locals,unused-variable,unused-argument,else-if-used,consider-using-from-import,duplicate-code,line-too-long,missing-module-docstring,missing-function-docstring,missing-param-doc,missing-type-doc,missing-raises-doc" --jobs=0 pylint src/probnum/quad --disable="too-many-arguments,missing-module-docstring" --jobs=0 From 7680742b49926c2eca5e9915fb62d2a0d4cc751e Mon Sep 17 00:00:00 2001 From: Lutfi Randiva Date: Mon, 18 Apr 2022 18:05:18 +0800 Subject: [PATCH 2/4] Fixed else-if-used in probnum.problems --- src/probnum/problems/zoo/diffeq/_ivp_examples.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/probnum/problems/zoo/diffeq/_ivp_examples.py b/src/probnum/problems/zoo/diffeq/_ivp_examples.py index fe944b8b4..b337479a0 100644 --- a/src/probnum/problems/zoo/diffeq/_ivp_examples.py +++ b/src/probnum/problems/zoo/diffeq/_ivp_examples.py @@ -519,11 +519,10 @@ def lorenz96(t0=0.0, tmax=30.0, y0=None, num_variables=5, params=(8.0,)): if num_variables < 4: raise ValueError("The number of variables must be at least 4.") y0 = np.ones(num_variables) * constant_forcing - else: - if len(y0) < 4: - raise ValueError( - "The number of variables (i.e. the length of the initial vector) must be at least 4." - ) + elif (len(y0) < 4): + raise ValueError( + "The number of variables (i.e. the length of the initial vector) must be at least 4." + ) def lorenz96_f_vec(t, y, c=constant_forcing): """Lorenz 96 model with constant forcing.""" From 36b585607b33b28ceeab17240168916e6cd739ce Mon Sep 17 00:00:00 2001 From: Lutfi Randiva Date: Tue, 19 Apr 2022 17:39:43 +0800 Subject: [PATCH 3/4] Remove parentheses in _ivp_examples.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicholas Krämer --- src/probnum/problems/zoo/diffeq/_ivp_examples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/probnum/problems/zoo/diffeq/_ivp_examples.py b/src/probnum/problems/zoo/diffeq/_ivp_examples.py index b337479a0..5abfe1a88 100644 --- a/src/probnum/problems/zoo/diffeq/_ivp_examples.py +++ b/src/probnum/problems/zoo/diffeq/_ivp_examples.py @@ -519,7 +519,7 @@ def lorenz96(t0=0.0, tmax=30.0, y0=None, num_variables=5, params=(8.0,)): if num_variables < 4: raise ValueError("The number of variables must be at least 4.") y0 = np.ones(num_variables) * constant_forcing - elif (len(y0) < 4): + elif len(y0) < 4: raise ValueError( "The number of variables (i.e. the length of the initial vector) must be at least 4." ) From 71760a6f594e4cade09c9a2b8931e638f2653f78 Mon Sep 17 00:00:00 2001 From: Lutfi Randiva Date: Tue, 19 Apr 2022 18:09:44 +0800 Subject: [PATCH 4/4] Update tox.ini --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 7d5c93b3e..5d6dadc03 100644 --- a/tox.ini +++ b/tox.ini @@ -68,9 +68,9 @@ commands = # Per-package Linting Passes pylint src/probnum/diffeq --disable="redefined-outer-name,too-many-instance-attributes,too-many-arguments,too-many-locals,too-few-public-methods,protected-access,unnecessary-pass,unused-variable,unused-argument,no-self-use,duplicate-code,missing-function-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc" --jobs=0 pylint src/probnum/filtsmooth --disable="no-member,arguments-differ,too-many-arguments,too-many-locals,too-few-public-methods,protected-access,unused-variable,unused-argument,no-self-use,duplicate-code,useless-param-doc" --jobs=0 - pylint src/probnum/linalg --disable="no-member,abstract-method,arguments-differ,redefined-builtin,too-many-instance-attributes,too-many-arguments,too-many-locals,too-many-lines,too-many-statements,too-many-branches,too-complex,too-few-public-methods,protected-access,unused-argument,attribute-defined-outside-init,no-else-return,no-else-raise,no-self-use,duplicate-code,missing-module-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc" --jobs=0 + pylint src/probnum/linalg --disable="no-member,abstract-method,arguments-differ,else-if-used,redefined-builtin,too-many-instance-attributes,too-many-arguments,too-many-locals,too-many-lines,too-many-statements,too-many-branches,too-complex,too-few-public-methods,protected-access,unused-argument,attribute-defined-outside-init,no-else-return,no-else-raise,no-self-use,duplicate-code,missing-module-docstring,missing-param-doc,missing-type-doc,missing-raises-doc,missing-return-type-doc" --jobs=0 pylint src/probnum/linops --disable="too-many-instance-attributes,too-many-arguments,too-many-locals,protected-access,no-else-return,no-else-raise,else-if-used,missing-class-docstring,missing-function-docstring,missing-raises-doc,duplicate-code" --jobs=0 - pylint src/probnum/problems --disable="too-many-arguments,too-many-locals,unused-variable,unused-argument,else-if-used,consider-using-from-import,duplicate-code,line-too-long,missing-module-docstring,missing-function-docstring,missing-param-doc,missing-type-doc,missing-raises-doc" --jobs=0 + pylint src/probnum/problems --disable="too-many-arguments,too-many-locals,unused-variable,unused-argument,consider-using-from-import,duplicate-code,line-too-long,missing-module-docstring,missing-function-docstring,missing-param-doc,missing-type-doc,missing-raises-doc" --jobs=0 pylint src/probnum/quad --disable="too-many-arguments,missing-module-docstring" --jobs=0 pylint src/probnum/randprocs --disable="arguments-differ,arguments-renamed,too-many-instance-attributes,too-many-arguments,too-many-locals,protected-access,unused-argument,no-else-return,duplicate-code,missing-module-docstring,missing-class-docstring,missing-function-docstring,missing-type-doc,missing-raises-doc,useless-param-doc,useless-type-doc,missing-return-type-doc" --jobs=0 pylint src/probnum/randprocs/kernels --disable="duplicate-code" --jobs=0