Skip to content

Commit 8811bd6

Browse files
authored
Merge pull request #445 from PyLops/dev
Move PyLops v2 from dev to master
2 parents 6311b1a + efcfada commit 8811bd6

File tree

260 files changed

+19116
-9005
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+19116
-9005
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: [3.6, 3.7, 3.8]
11+
python-version: [3.7, 3.8, 3.9]
1212

1313
steps:
1414
- uses: actions/checkout@v2

.github/workflows/flake8.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This workflow runs Flake8 on the PR
2+
# For more information see: https://github.com/marketplace/actions/python-flake8-lint
3+
name: PyLops-flake8
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
flake8-lint:
9+
runs-on: ubuntu-latest
10+
name: Lint
11+
steps:
12+
- name: Check out source repository
13+
uses: actions/checkout@v2
14+
- name: Set up Python environment
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: "3.8"
18+
- name: flake8 Lint
19+
uses: py-actions/flake8@v2
20+
with:
21+
ignore: "E203,E501,W503,E402"
22+
max-line-length: "88"
23+
path: "pylops"
24+
args: "--per-file-ignores=__init__.py:F401,F403,F405"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pylops/version.py
2525
.ipynb_checkpoints/
2626
notebooks
2727
TODO
28+
.vscode/
2829

2930
# Documentation #
3031
docs/build

.pre-commit-config.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
- id: check-yaml
99

1010
- repo: https://github.com/psf/black
11-
rev: 21.12b0
11+
rev: 22.3.0
1212
hooks:
1313
- id: black
1414
args: # arguments to configure black
@@ -19,4 +19,12 @@ repos:
1919
hooks:
2020
- id: isort
2121
name: isort (python)
22-
args: ["--profile", "black", "--filter-files", "--line-length=88"]
22+
args:
23+
[
24+
"--profile",
25+
"black",
26+
"--skip",
27+
"__init__.py",
28+
"--filter-files",
29+
"--line-length=88",
30+
]

CHANGELOG.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
1+
# 2.0.0
2+
PyLops has undergone significant changes in this release, including new ``LinearOperator``s, more features, new examples and bugfixes.
3+
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).
4+
5+
### New Features
6+
7+
* Multiplication of linear operators by N-dimensional arrays is now supported via the new ``dims``/``dimsd`` properties.
8+
Users do not need to use ``.ravel`` and ``.reshape`` as often anymore. See the migration guide for more information.
9+
* Typing annotations for several submodules (``avo``, ``basicoperators``, ``signalprocessing``, ``utils``, ``optimization``, ``waveeqprocessing``)
10+
* New [pylops.TorchOperator](https://pylops.readthedocs.io/en/latest/api/generated/pylops.TorchOperator.html#pylops.TorchOperator)
11+
wraps a Pylops operator into a PyTorch function
12+
* New [pylops.signalprocessing.Patch3D](https://pylops.readthedocs.io/en/latest/api/generated/pylops.signalprocessing.Patch3D.html)
13+
applies a linear operator repeatedly to patches of the model vector
14+
* Each of [Sliding1D](https://pylops.readthedocs.io/en/latest/api/generated/pylops.signalprocessing.Sliding1D.html),
15+
[Sliding2D](https://pylops.readthedocs.io/en/latest/api/generated/pylops.signalprocessing.Sliding2D.html),
16+
[Sliding3D](https://pylops.readthedocs.io/en/latest/api/generated/pylops.signalprocessing.Sliding3D.html),
17+
[Patch2D](https://pylops.readthedocs.io/en/latest/api/generated/pylops.signalprocessing.Patch2D.html) and
18+
[Patch3D](https://pylops.readthedocs.io/en/latest/api/generated/pylops.signalprocessing.Patch3D.html) have an associated
19+
`slidingXd_design` or `patchXd_design` functions associated with them to aid the user in designing the windows
20+
* [FirstDerivative](https://pylops.readthedocs.io/en/latest/api/generated/pylops.FirstDerivative.html) and
21+
[SecondDerivative](https://pylops.readthedocs.io/en/latest/api/generated/pylops.SecondDerivative.html), and therefore
22+
other derivative operators which rely on the (e.g., [Gradient](https://pylops.readthedocs.io/en/latest/api/generated/pylops.Gradient.html))
23+
support higher order stencils
24+
* [pylops.waveeqprocessing.Kirchhoff](https://pylops.readthedocs.io/en/latest/api/generated/pylops.waveeqprocessing.Kirchhoff.html)
25+
substitutes [pylops.waveeqprocessing.Demigration](https://pylops.readthedocs.io/en/v1.18.3/api/generated/pylops.waveeqprocessing.Demigration.html)
26+
and incorporates a variety of new functionalities
27+
* New [pylops.waveeqprocessing.AcousticWave2D](https://pylops.readthedocs.io/en/latest/api/generated/pylops.waveeqprocessing.AcousticWave2D.html) wraps the [Devito](https://www.devitoproject.org/)
28+
acoutic wave propagator providing a wave-equation based Born modeling operator with a reverse-time migration adjoint
29+
* Solvers can now be implemented via the [pylops.optimization.basesolver.Solver](https://pylops.readthedocs.io/en/latest/api/generated/pylops.optimization.basesolver.Solver.html) class.
30+
They can now be used through a functional interface with lowercase name (e.g., [splitbregman](https://pylops.readthedocs.io/en/latest/api/generated/pylops.optimization.sparsity.splitbregman.html))
31+
or via class interface with CamelCase name (e.g., [SplitBregman](https://pylops.readthedocs.io/en/latest/api/generated/pylops.optimization.cls_sparsity.SplitBregman.html)).
32+
Moreover, solvers now accept callbacks defined by the [Callbacks](https://pylops.readthedocs.io/en/latest/api/generated/pylops.optimization.callback.Callbacks.html)
33+
interface (see e.g., [MetricsCallback](https://pylops.readthedocs.io/en/latest/api/generated/pylops.optimization.callback.MetricsCallback.html)).
34+
* [Metrics](https://pylops.readthedocs.io/en/latest/api/others.html#metrics) such as [mean absolute error (mae)](https://pylops.readthedocs.io/en/latest/api/generated/pylops.utils.metrics.mae.html#pylops.utils.metrics.mae), [mean squared error (mse)](https://pylops.readthedocs.io/en/latest/api/generated/pylops.utils.metrics.mse.html#pylops.utils.metrics.mse) and others
35+
* New [pylops.utils.signalprocessing.dip_estimate](https://pylops.readthedocs.io/en/latest/api/generated/pylops.utils.signalprocessing.dip_estimate.html)
36+
estimates local dips in an image (measured in radians) in a stabler way than [pylops.utils.signalprocessing.dip_estimate](https://pylops.readthedocs.io/en/latest/api/generated/pylops.utils.signalprocessing.slope_estimate.html) did for slopes.
37+
* New [pylops.utils.tapers.tapernd](https://pylops.readthedocs.io/en/latest/api/generated/pylops.utils.tapers.tapernd.html) for N-dimensional tapers
38+
* New wavelets [Klauder](https://pylops.readthedocs.io/en/latest/api/generated/pylops.utils.wavelets.klauder.html) and [Ormsby](https://pylops.readthedocs.io/en/latest/api/generated/pylops.utils.wavelets.ormsby.html)
39+
40+
### Documentation
41+
42+
* [Installation](https://pylops.readthedocs.io/en/latest/installation.html) has been revamped
43+
* Revamped guide on how to [implement a new `LinearOperator` from scratch](https://pylops.readthedocs.io/en/latest/adding.html)
44+
* New guide on how to [implement a new solver from scratch](https://pylops.readthedocs.io/en/latest/addingsolver.html)
45+
* New tutorials:
46+
* [Solvers (Advanced)](https://pylops.readthedocs.io/en/latest/tutorials/classsolvers.html)
47+
* [Deblending](https://pylops.readthedocs.io/en/latest/tutorials/deblending.html)
48+
* [Automatic Differentiation](https://pylops.readthedocs.io/en/latest/tutorials/torchop.html)
49+
* New gallery examples:
50+
* [Patching](https://pylops.readthedocs.io/en/latest/gallery/plot_patching.html#sphx-glr-gallery-plot-patching-py)
51+
* [Wavelets](https://pylops.readthedocs.io/en/latest/gallery/plot_wavs.html)
52+
53+
# 1.18.3
54+
* Fixed ``pylops.optimization.basic.lsqr``, ``pylops.optimization.sparsity.ISTA``, and
55+
``pylops.optimization.sparsity.FISTA`` to work with cupy arrays. This change was required
56+
by how recent cupy versions handle scalars, which are not converted directly into float types,
57+
rather kept as cupy arrays.
58+
* Fixed bug in ``pylops.waveeqprocessing.Deghosting`` introduced in
59+
commit [7e596d4](https://github.com/PyLops/pylops/commit/7e596d4dad3793d6430204b7a9b214a9dc39616c)
60+
61+
# 1.18.2
62+
* Refractored `pylops.utils.dottest`, and added two new optional input parameters
63+
(``atol`` and ``rtol``)
64+
* Added optional parameter ``densesolver`` to ``pylops.LinearOperator.div``
65+
66+
# 1.18.1
67+
* !DELETED! due to a mistake in the release process
68+
169
# 1.18.0
270
* Added `NMO` example to gallery
371
* Extended `pylops.basicoperators.Laplacian` to N-dimensional arrays

CONTRIBUTING.md

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22

33
Contributions are welcome and greatly appreciated!
44

5+
The best way to get in touch with the core developers and maintainers is to
6+
join the [PyLops slack channel](https://pylops.slack.com/) as well as
7+
open new *Issues* directly from the GitHub repo.
58

6-
## Types of Contributions
9+
Moreover, take a look at the [Roadmap](https://pylops.readthedocs.io/en/stable/roadmap.html)
10+
page for a list of current ideas for improvements and additions to the PyLops library.
711

8-
### Report Bugs
12+
13+
## Welcomed contributions
14+
15+
### Bug reports
916

1017
Report bugs at https://github.com/PyLops/pylops/issues
1118

@@ -16,7 +23,7 @@ reporting it including:
1623
* Any details about your Python environment.
1724
* Detailed steps to reproduce the bug.
1825

19-
### Propose New Operators or Features
26+
### New operators and features
2027

2128
The best way to send feedback is to open an issue at
2229
https://github.com/PyLops/pylops/issues
@@ -27,52 +34,57 @@ If you are proposing a new operator or a new feature:
2734
* Explain in detail how it should work.
2835
* Keep the scope as narrow as possible, to make it easier to implement.
2936

30-
### Implement Operators or Features
31-
Look through the Git issues for operator or feature requests.
32-
Anything tagged with *enhancement* is open to whoever wants to
33-
implement it.
37+
### Fix issues
38+
There is always a backlog of issues that need to be dealt with.
39+
Look through the GitHub Issues for operator/feature requests or bugfixes.
3440

35-
### Add Examples or improve Documentation
41+
### Add examples or improve documentation
3642
Writing new operators is not the only way to get involved and
3743
contribute. Create examples with existing operators as well as
3844
improving the documentation of existing operators is as important
3945
as making new operators and very much encouraged.
4046

4147

42-
## Getting Started to contribute
48+
## Step-by-step instructions for contributing
4349

4450
Ready to contribute?
4551

46-
1. Fork the `PyLops` repo.
52+
1. Follow all installation instructions in the [Step-by-step installation for developers](https://pylops.readthedocs.io/en/stable/installation.html#step-by-step-installation-for-developers) section of the documentation.
4753

48-
2. Clone your fork locally:
54+
2. Create a branch for local development, usually starting from the dev branch:
4955
```
50-
git clone https://github.com/your_name_here/pylops.git
56+
git checkout -b name-of-your-branch dev
5157
```
58+
Now you can make your changes locally.
5259
53-
3. Follow the installation instructions for *developers* that you find
54-
in the README.md or in the online documentation.
55-
Ensure that you are able to *pass all the tests before moving forward*.
56-
57-
4. Create a branch for local development:
60+
3. When you're done making changes, check that your code follows the guidelines for [Implementing new operators](https://pylops.readthedocs.io/en/stable/adding.html) and
61+
that the both old and new tests pass successfully:
5862
```
59-
git checkout -b name-of-your-branch
63+
make tests
6064
```
61-
Now you can make your changes locally.
6265
63-
5. When you're done making changes, check that old and new tests pass
64-
succesfully:
66+
4. Run flake8 to check the quality of your code:
6567
```
66-
make tests
68+
make lint
6769
```
70+
Note that PyLops does not enforce full compliance with flake8, rather this is used as a
71+
guideline and will also be run as part of our CI.
72+
Make sure to limit to a minimum flake8 warnings before making a PR.
73+
74+
5. Update the docs
75+
```
76+
make docupdate
77+
```
6878
69-
6. Commit your changes and push your branch to GitLab::
79+
6. Commit your changes and push your branch to GitHub:
7080
```
7181
git add .
7282
git commit -m "Your detailed description of your changes."
7383
git push origin name-of-your-branch
7484
```
7585
Remember to add ``-u`` when pushing the branch for the first time.
86+
We recommend using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary)
87+
to format your commit messages, but this is not enforced.
7688
7789
7. Submit a pull request through the GitHub website.
7890
@@ -83,3 +95,13 @@ Before you submit a pull request, check that it meets these guidelines:
8395
8496
1. The pull request should include new tests for all the core routines that have been developed.
8597
2. If the pull request adds functionality, the docs should be updated accordingly.
98+
3. Ensure that the updated code passes all tests.
99+
100+
## Project structure
101+
This repository is organized as follows:
102+
* **pylops**: Python library containing various linear operators and auxiliary routines
103+
* **pytests**: set of pytests
104+
* **testdata**: sample datasets used in pytests and documentation
105+
* **docs**: Sphinx documentation
106+
* **examples**: set of python script examples for each linear operator to be embedded in documentation using sphinx-gallery
107+
* **tutorials**: set of python script tutorials to be embedded in documentation using sphinx-gallery

0 commit comments

Comments
 (0)