Skip to content

Commit

Permalink
Merge pull request #499 from PyLops/dev
Browse files Browse the repository at this point in the history
Merge for v2.1.0
  • Loading branch information
mrava87 authored Mar 17, 2023
2 parents a0b69b8 + a8ae275 commit 73af25c
Show file tree
Hide file tree
Showing 95 changed files with 4,827 additions and 934 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
platform: [ ubuntu-latest, macos-latest ]
python-version: ["3.7", "3.8", "3.9", "3.10"]

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/codacy-coverage-reporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow uploads PyLops coverage analysis on Codacy
# For more information see: https://github.com/codacy/codacy-coverage-reporter-action
name: PyLops-coverage

on: [push, pull_request_target]

jobs:
build:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest coverage
if [ -f requirements.txt ]; then pip install -r requirements-dev.txt; fi
- name: Install pylops
run: |
pip install .
- name: Code coverage with coverage
run: |
coverage run -m pytest
coverage xml
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
4 changes: 2 additions & 2 deletions .github/workflows/flake8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: flake8 Lint
Expand Down
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# 2.1.0
* Added `pylops.signalprocessing.DCT`, `pylops.signalprocessing.NonStationaryConvolve1D`,
`pylops.signalprocessing.NonStationaryConvolve2D`, `pylops.signalprocessing.NonStationaryFilters1D`, and
`pylops.signalprocessing.NonStationaryFilters2D` operators
* Added `pylops.waveeqprocessing.BlendingContinuous`, `pylops.waveeqprocessing.BlendingGroup`, and
`pylops.waveeqprocessing.BlendingHalf` operators
* Added `kind='datamodel'` to `pylops.optimization.cls_sparsity.IRLS`
* Improved inner working of `pylops.waveeqprocessing.Kirchhoff` operator significantly
reducing the memory usage related to storing traveltime, angle, and amplitude tables.
* Improved handling of `haxes` in `pylops.signalprocessing.Radon2D` and `pylops.signalprocessing.Radon3D` operators
* Added possibility to feed ND-arrays to `pylops.TorchOperator`
* Removed `pylops.LinearOperator` inheritance and added `__call__` method to `pylops.TorchOperator`
* Removed `scipy.sparse.linalg.LinearOperator` and added `abc.ABC` inheritance to `pylops.LinearOperator`
* All operators are now classes of `pylops.LinearOperator` type

# 2.0.0
PyLops has undergone significant changes in this release, including new ``LinearOperator``s, more features, new examples and bugfixes.
To aid users in navigating the breaking changes, we provide the following document [MIGRATION_V1_V2.md](https://github.com/PyLops/pylops/blob/dev/MIGRATION_V1_V2.md).
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ doc:
docupdate:
cd docs && make html && cd ..

servedoc:
$(PYTHON) -m http.server --directory docs/build/html/

lint:
flake8 docs/ examples/ pylops/ pytests/ tutorials/

typeannot:
mypy pylops/

coverage:
coverage run -m pytest && coverage xml && coverage html && $(PYTHON) -m http.server --directory htmlcov/
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,8 @@ A list of video tutorials to learn more about PyLops:
* Alan Richardson, ar4
* BurningKarl, BurningKarl
* Nick Luiken, NickLuiken
* BurningKarl, BurningKarl
* Muhammad Izzatullah, izzatum
* Juan Daniel Romero, jdromerom
* Aniket Singh Rawat, dikwickley
* Rohan Babbar, rohanbabbar04
5 changes: 5 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import 'theme.css';

.sphx-glr-multi-img {
max-width: 100%;
}
34 changes: 0 additions & 34 deletions docs/source/_templates/breadcrumbs.html

This file was deleted.

13 changes: 7 additions & 6 deletions docs/source/adding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ which will be used as *parent* class for any of our operators:
from pylops import LinearOperator
This class is a child of the
:py:class:`scipy.sparse.linalg.LinearOperator` class itself which implements the same methods of its parent class
as well as an additional method for quick inversion: such method can be easily accessed by using ``\`` between the
operator and the data (e.g., ``A \ y``).
This class was originally defined as a child of the :py:class:`scipy.sparse.linalg.LinearOperator`, implementing
the same methods of its parent class as well as additional methods for quick inversion (e.g., ``A \ y``),
eigenvalues computation, conversion to dense matrices, etc. From version ``v2.1`` onwards, our linear operator
class has become stand-alone; however, by keeping the same naming structure of the original scipy class, we still
allow inter-operability with scipy-native linear operators and solvers.

After that we define our new object:

.. code-block:: python
class Diagonal(LinearOperator):
followed by a `numpydoc docstring <https://numpydoc.readthedocs.io/en/latest/format.html/>`_
followed by a `numpydoc docstring <https://numpydoc.readthedocs.io/en/latest/format.html>`__
(starting with ``r"""`` and ending with ``"""``) containing the documentation of the operator. Such docstring should
contain at least a short description of the operator, a ``Parameters`` section with a detailed description of the
input parameters and a ``Notes`` section providing a mathematical explanation of the operator. Take a look at
Expand Down Expand Up @@ -172,7 +173,7 @@ adheres to the guidelines of PyLops:

- the new class contains at least ``__init__``, ``_matvec`` and ``_matvec`` methods.

- the new class (or function) has a `numpydoc docstring <https://numpydoc.readthedocs.io/>`_ documenting
- the new class (or function) has a `numpydoc docstring <https://numpydoc.readthedocs.io/>`__ documenting
at least the input ``Parameters`` and with a ``Notes`` section providing a mathematical explanation of the operator

- a new test has been added to an existing ``test_*.py`` file within the ``pytests`` folder. The test should verify
Expand Down
8 changes: 4 additions & 4 deletions docs/source/addingsolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ After that we define our new object:
class CG(Solver):
followed by a `numpydoc docstring <https://numpydoc.readthedocs.io/en/latest/format.html/>`_
followed by a `numpydoc docstring <https://numpydoc.readthedocs.io/en/latest/format.html/>`__
(starting with ``r"""`` and ending with ``"""``) containing the documentation of the solver. Such docstring should
contain at least a short description of the solver, a ``Parameters`` section with a description of the
input parameters of the associated ``_init__`` method and a ``Notes`` section providing a reference to the original
Expand Down Expand Up @@ -143,7 +143,7 @@ model and the same hyperparameters of the setup method and runs the entire optim

.. code-block:: python
def solve(self, y, x0=None, niter=10, tol=1e-4, show=False, itershow=[10, 10, 10]):
def solve(self, y, x0=None, niter=10, tol=1e-4, show=False, itershow=(10, 10, 10)):
x = self.setup(y=y, x0=x0, niter=niter, tol=tol, show=show)
x = self.run(x, niter, show=show, itershow=itershow)
self.finalize(show)
Expand All @@ -169,7 +169,7 @@ input and returns some of the most valuable properties of the class-based solver

.. code-block:: python
def cg(Op, y, x0, niter=10, tol=1e-4, show=False, itershow=[10, 10, 10], callback=None):
def cg(Op, y, x0, niter=10, tol=1e-4, show=False, itershow=(10, 10, 10), callback=None):
cgsolve = CG(Op)
if callback is not None:
cgsolve.callback = callback
Expand Down Expand Up @@ -239,7 +239,7 @@ adheres to the guidelines of PyLops:

- the new class contains at least ``__init__``, ``setup``, ``step``, ``run``, ``finalize``, and ``solve`` methods.

- each of the above methods have a `numpydoc docstring <https://numpydoc.readthedocs.io/>`_ documenting
- each of the above methods have a `numpydoc docstring <https://numpydoc.readthedocs.io/>`__ documenting
at least the input ``Parameters`` and the ``__init__`` method contains also a ``Notes`` section providing a
mathematical explanation of the solver.

Expand Down
8 changes: 8 additions & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ Signal processing
Convolve1D
Convolve2D
ConvolveND
NonStationaryConvolve1D
NonStationaryConvolve2D
NonStationaryFilters1D
NonStationaryFilters2D
Interp
Bilinear
FFT
Expand All @@ -97,6 +101,7 @@ Signal processing
Shift
DWT
DWT2D
DCT
Seislet
Radon2D
Radon3D
Expand All @@ -121,6 +126,9 @@ Wave-Equation processing
PressureToVelocity
UpDownComposition2D
UpDownComposition3D
BlendingContinuous
BlendingGroup
BlendingHalf
MDC
PhaseShift
Kirchhoff
Expand Down
24 changes: 22 additions & 2 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
Changelog
=========

Version 2.1.0
-------------

*Released on: 17/03/2023*

* Added :class:`pylops.signalprocessing.DCT`, :class:`pylops.signalprocessing.NonStationaryConvolve1D`,
:class:`pylops.signalprocessing.NonStationaryConvolve2D`, :class:`pylops.signalprocessing.NonStationaryFilters1D`, and
:class:`pylops.signalprocessing.NonStationaryFilters2D` operators
* Added :class:`pylops.waveeqprocessing.BlendingContinuous`, :class:`pylops.waveeqprocessing.BlendingGroup`, and
:class:`pylops.waveeqprocessing.BlendingHalf` operators
* Added `kind='datamodel'` to :class:`pylops.optimization.cls_sparsity.IRLS`
* Improved inner working of :class:`pylops.waveeqprocessing.Kirchhoff` operator significantly
reducing the memory usage related to storing traveltime, angle, and amplitude tables.
* Improved handling of `haxes` in :class:`pylops.signalprocessing.Radon2D` and :class:`pylops.signalprocessing.Radon3D` operators
* Added possibility to feed ND-arrays to :class:`pylops.TorchOperator`
* Removed :class:`pylops.LinearOperator` inheritance and added `__call__` method to :class:`pylops.TorchOperator`
* Removed `scipy.sparse.linalg.LinearOperator` and added :class:`abc.ABC` inheritance to :class:`pylops.LinearOperator`
* All operators are now classes of `:class:`pylops.LinearOperator` type


Version 2.0.0
-------------

Expand Down Expand Up @@ -98,7 +118,7 @@ Version 1.18.0
* Extended :py:func:`pylops.Laplacian` to N-dimensional arrays
* Added `forward` kind to :py:class:`pylops.SecondDerivative` and
:py:func:`pylops.Laplacian`
* Added `chirp-sliding` kind to :py:func:`pylops.waveeqprocessing.seismicinterpolation.SeismicInterpolation`
* Added `chirp-sliding` kind to :py:class:`pylops.waveeqprocessing.seismicinterpolation.SeismicInterpolation`
* Fixed bug due to the new internal structure of `LinearOperator` submodule introduced in `scipy1.8.0`


Expand Down Expand Up @@ -245,7 +265,7 @@ Version 1.11.1
*Released on: 24/10/2020*

* Fixed import of ``pyfttw`` when not available in
:py:class:``pylops.signalprocessing.ChirpRadon3D`
:py:class:`pylops.signalprocessing.ChirpRadon3D`


Version 1.11.0
Expand Down
17 changes: 13 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@

# Sphinx project configuration
templates_path = ["_templates"]
exclude_patterns = ["_build", "**.ipynb_checkpoints"]
exclude_patterns = ["_build", "**.ipynb_checkpoints", "**.ipynb", "**.md5"]
source_suffix = ".rst"


# The encoding of source files.
source_encoding = "utf-8-sig"
master_doc = "index"
Expand All @@ -101,13 +103,12 @@
""".format(
year=year
)

html_static_path = ["_static"]
html_last_updated_fmt = "%b %d, %Y"
html_title = "PyLops"
html_short_title = "PyLops"
html_logo = "_static/pylops.png"
html_favicon = "_static/favicon.ico"
html_static_path = ["_static"]
html_extra_path = []
pygments_style = "default"
add_function_parentheses = False
Expand All @@ -116,11 +117,19 @@
html_show_copyright = True

# Theme config
html_theme = "sphinx_rtd_theme"
html_theme = "pydata_sphinx_theme"
html_theme_options = {
"logo_only": True,
"display_version": True,
"logo": {
"image_light": "pylops_b.png",
"image_dark": "pylops.png",
}
}
html_css_files = [
'css/custom.css',
]

html_context = {
"menu_links_name": "Repository",
"menu_links": [
Expand Down
4 changes: 4 additions & 0 deletions docs/source/credits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ Contributors
* `Alan Richardson <https://github.com/ar4>`_, ar4
* `BurningKarl <https://github.com/BurningKarl>`_, BurningKarl
* `Nick Luiken <https://github.com/NickLuiken>`_, NickLuiken
* `Muhammad Izzatullah <https://github.com/izzatum>`_, izzatum
* `Juan Daniel Romero <https://github.com/jdromerom>`_, jdromerom
* `Aniket Singh Rawat <https://github.com/dikwickley>`_, dikwickley
* `Rohan Babbar <https://github.com/rohanbabbar04>`_, rohanbabbar04
Loading

0 comments on commit 73af25c

Please sign in to comment.