Skip to content

Commit bd032bf

Browse files
authored
Merge pull request #713 from mrava87/doc-laplacian
fix: pass kind to Laplacian
2 parents 8a202f2 + 68fd2c7 commit bd032bf

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

pylops/basicoperators/gradient.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class Gradient(LinearOperator):
2929
Derivative kind (``forward``, ``centered``, or ``backward``).
3030
dtype : :obj:`str`, optional
3131
Type of elements in input array.
32+
name : :obj:`str`, optional
33+
.. versionadded:: 2.0.0
34+
35+
Name of operator (to be used by :func:`pylops.utils.describe.describe`)
3236
3337
Attributes
3438
----------

pylops/basicoperators/laplacian.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Laplacian(LinearOperator):
2121
----------
2222
dims : :obj:`tuple`
2323
Number of samples for each dimension.
24-
axes : :obj:`int`, optional
24+
axes : :obj:`tuple`, optional
2525
.. versionadded:: 2.0.0
2626
2727
Axes along which the Laplacian is applied.
@@ -37,6 +37,10 @@ class Laplacian(LinearOperator):
3737
Derivative kind (``forward``, ``centered``, or ``backward``)
3838
dtype : :obj:`str`, optional
3939
Type of elements in input array.
40+
name : :obj:`str`, optional
41+
.. versionadded:: 2.0.0
42+
43+
Name of operator (to be used by :func:`pylops.utils.describe.describe`)
4044
4145
Attributes
4246
----------
@@ -54,7 +58,7 @@ class Laplacian(LinearOperator):
5458
Raises
5559
------
5660
ValueError
57-
If ``axes``. ``weights``, and ``sampling`` do not have the same size
61+
If ``axes``, ``weights``, and ``sampling`` do not have the same size
5862
5963
Notes
6064
-----
@@ -122,6 +126,6 @@ def _calc_l2op(
122126
l2op *= weights[0]
123127
for ax, samp, weight in zip(axes[1:], sampling[1:], weights[1:]):
124128
l2op += weight * SecondDerivative(
125-
dims, axis=ax, sampling=samp, edge=edge, dtype=dtype
129+
dims, axis=ax, sampling=samp, edge=edge, kind=kind, dtype=dtype
126130
)
127131
return l2op

pylops/basicoperators/secondderivative.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class SecondDerivative(LinearOperator):
6464
direction of a multi-dimensional array.
6565
6666
For simplicity, given a one dimensional array, the second-order centered
67-
first derivative is:
67+
second derivative is:
6868
6969
.. math::
7070
y[i] = (x[i+1] - 2x[i] + x[i-1]) / \Delta x^2

0 commit comments

Comments
 (0)