Skip to content

Commit

Permalink
Resolve pylint line-too-long for linops (#682)
Browse files Browse the repository at this point in the history
* Remove line-to-long for _problems

* Remove

* Remove line-too-long for _scaling

* -

* Remove line-too-long from /linops and add to/problems

* Update _kronecker.py

* Fix trailing-whitespace

* Fix trailing whitespace for kroneker

* Fix trailing-whitespaces for _linear_operator
  • Loading branch information
PrSh27 authored Mar 28, 2022
1 parent a84f9c1 commit 672d19b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/probnum/linops/_kronecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
class Symmetrize(_linear_operator.LinearOperator):
r"""Symmetrizes a vector in its matrix representation.
Given a vector :math:`x=\operatorname{vec}(X)` representing a square matrix :math:`X`, this linear operator computes :math:`y=\operatorname{vec}(\frac{1}{2}(X + X^\top))`.
Given a vector :math:`x=\operatorname{vec}(X)`
representing a square matrix :math:`X`,
this linear operator computes :math:
`y=\operatorname{vec}(\frac{1}{2}(X + X^\top))`.
Parameters
----------
Expand Down
12 changes: 7 additions & 5 deletions src/probnum/linops/_linear_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class LinearOperator:
:class:`LinearOperator`, that defers linear operations to the original operators and
combines the results.
To construct a concrete :class:`LinearOperator`, either pass appropriate callables to
the constructor of this class, or subclass it.
To construct a concrete :class:`LinearOperator`, either pass appropriate callables
to the constructor of this class, or subclass it.
A subclass must implement either one of the methods ``_matvec`` and ``_matmat``, and
the attributes/properties ``shape`` (pair of integers) and ``dtype`` (may be
Expand Down Expand Up @@ -254,7 +254,8 @@ def astype(
casting:
Controls what kind of data casting may occur.
subok:
If True, then sub-classes will be passed-through (default). False is currently not supported for linear operators.
If True, then sub-classes will be passed-through (default).
False is currently not supported for linear operators.
copy:
Whether to return a new linear operator, even if ``dtype`` is the same.
"""
Expand Down Expand Up @@ -828,8 +829,9 @@ def __matmul__(
Returns
-------
y :
A `np.matrix` or `np.ndarray` or `RandomVariable` with shape `(M,)` or `(M, 1)`,
depending on the type and shape of the x argument.
A `np.matrix` or `np.ndarray` or `RandomVariable` with
shape `(M,)` or `(M, 1)`,depending on the type and
shape of the x argument.
Notes
-----
This matvec wraps the user-specified matvec routine or overridden
Expand Down
3 changes: 2 additions & 1 deletion src/probnum/linops/_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
class Scaling(_linear_operator.LinearOperator):
r"""Scaling linear operator.
Creates a diagonal linear operator which (non-uniformly) scales elements of vectors, defined by
Creates a diagonal linear operator which (non-uniformly)
scales elements of vectors, defined by
.. math::
v \mapsto \begin{bmatrix}
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ commands =
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-else-return,no-else-raise,no-self-use,duplicate-code,line-too-long,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,line-too-long,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,line-too-long,missing-class-docstring,missing-function-docstring,missing-raises-doc,duplicate-code" --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
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,line-too-long,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
Expand Down

0 comments on commit 672d19b

Please sign in to comment.