Skip to content

Commit

Permalink
Fixed else-if-used pylint message in probnum.problems subpackage (#…
Browse files Browse the repository at this point in the history
…704)

* Removed else-if-used from pylint probnum/problems.

* Fixed else-if-used in probnum.problems

* Remove parentheses in _ivp_examples.py

Co-authored-by: Nicholas Krämer <[email protected]>

* Update tox.ini

Co-authored-by: Nicholas Krämer <[email protected]>
  • Loading branch information
Lutfi Randiva and pnkraemer authored Apr 19, 2022
1 parent b9a0a44 commit 731a4c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/probnum/problems/zoo/diffeq/_ivp_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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,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,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
Expand Down

0 comments on commit 731a4c6

Please sign in to comment.