Skip to content

Commit

Permalink
Merge pull request #146 from PyLops/dev
Browse files Browse the repository at this point in the history
Merge for v0.7.0
  • Loading branch information
mrava87 authored Nov 10, 2023
2 parents 30c4c80 + f6c378d commit 6befcf4
Show file tree
Hide file tree
Showing 35 changed files with 842 additions and 188 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,30 @@ on: [push, pull_request]

jobs:
build:

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

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- 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
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip setuptools
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements-dev.txt; fi
- name: Install pyproximal
run: |
python -m setuptools_scm
pip install .
- name: Test with pytest
run: |
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ sphinx:
python:
install:
- requirements: requirements-dev.txt
- method: setuptools
- method: pip
path: .
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 0.7.0

* Added ``pyproximal.proximal.RelaxedMumfordShah`` operator
* Added cuda version to the proximal operator of ``pyproximal.proximal.Simplex``
* Added bilinear update to ``pyproximal.optimization.primal.ProximalGradient``
* Modified ``pyproximal.optimization.pnp.PlugAndPlay`` function signature to allow using any proximal solver of choice
* Fixed print in ``pyproximal.optimization.primaldual.PrimalDual`` when using cupy arrays
* Fixed ``pyproximal.utils.bilinear.LowRankFactorizedMatrix`` when ``n=m``

# 0.6.0

:vertical_traffic_light: :vertical_traffic_light: This is the first release supporting PyLops v2.
Expand All @@ -14,7 +23,7 @@
:vertical_traffic_light: :vertical_traffic_light:

* Added ``pyproximal.proximal.Log1`` operator
* Allow ``radius`` parameter of ``pyproximal.optimization.primal.L0`` to be a function
* Allow ``radius`` parameter of ``pyproximal.proximal.L0`` to be a function
* Allow ``tau`` parameter of ``pyproximal.optimization.primal.HQS`` to be a vector
and change over iterations
* Added ``z0`` to ``pyproximal.optimization.primal.HQS``
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dev-install_conda:

tests:
make pythoncheck
$(PYTHON) setup.py test
pytest

doc:
cd docs && rm -rf source/api/generated && rm -rf source/gallery &&\
Expand Down
34 changes: 14 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# PyProximal
![PyProximal](https://github.com/PyLops/pyproximal/blob/dev/docs/source/_static/pyproximal_b.png)

[![PyPI version](https://badge.fury.io/py/pyproximal.svg)](https://badge.fury.io/py/pyproximal)
[![Build Status](https://travis-ci.com/PyLops/pyproximal.svg?branch=main)](https://travis-ci.com/PyLops/pyproximal)
[![AzureDevOps Status](https://dev.azure.com/matteoravasi/PyLops/_apis/build/status/PyLops.pyproximal?branchName=main)](https://dev.azure.com/matteoravasi/PyLops/_build/latest?definitionId=10&branchName=main)
[![AzureDevOps Status](https://dev.azure.com/matteoravasi/PyLops/_apis/build/status%2FPyLops.pyproximal?branchName=refs%2Fpull%2F129%2Fmerge)](https://dev.azure.com/matteoravasi/PyLops/_build/latest?definitionId=10&branchName=refs%2Fpull%2F129%2Fmerge)
![GithubAction Status](https://github.com/PyLops/pyproximal/workflows/PyProx/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/pyproximal/badge/?version=latest)](https://pyproximal.readthedocs.io/en/latest/?badge=latest)
[![OS-support](https://img.shields.io/badge/OS-linux,osx-850A8B.svg)](https://github.com/PyLops/pyproximal)
[![Slack Status](https://img.shields.io/badge/chat-slack-green.svg)](https://pylops.slack.com)



:vertical_traffic_light: :vertical_traffic_light: This library is under early development.
Expect things to constantly change until version v1.0.0. :vertical_traffic_light: :vertical_traffic_light:

Expand Down Expand Up @@ -75,11 +76,10 @@ xladmm, _ = LinearizedADMM(l2, l1, Dop, tau=tau, mu=mu,
```

## Why another library for proximal algorithms?

Several other projects in the Python ecosystem provide implementations of proximal
operators and/or algorithms, which present some clear overlap with this project.

A (possibly not exahustive) list of other projects is:
A (possibly not exhaustive) list of other projects is:

* http://proximity-operator.net
* https://github.com/ganguli-lab/proxalgs/blob/master/proxalgs/operators.py
Expand Down Expand Up @@ -110,39 +110,34 @@ This repository is organized as follows:
* **tutorials**: set of python script tutorials to be embedded in documentation using sphinx-gallery

## Getting started

You need **Python 3.8 or greater**.

*Note: Versions prior to v0.3.0 work alsi with Python 3.6 or greater, however they
*Note: Versions prior to v0.3.0 work also with Python 3.6 or greater, however they
require scipy version to be lower than v1.8.0.*


#### From PyPi

If you want to use PyProximal within your codes,
you want to use PyProximal within your codes,
install it in your Python environment by typing the following command in your terminal:

To get the most out of PyLops straight out of the box, we recommend `conda` to install PyLops:
```bash
conda install -c conda-forge pyproximal
```
pip install pyproximal
```

Open a python terminal and type:

#### From PyPi
You can also install pyproximal with `pip`:
```bash
pip install pylops
```
import pyproximal
```


#### From Github

You can also directly install from the master node (although this is not reccomended)
Finally, you can also directly install from the main branch (although this is not recommended)

```
pip install git+https://git@github.com/PyLops/pyproximal.git@main
```

## Contributing

*Feel like contributing to the project? Adding new operators or tutorial?*

We advise using the [Anaconda Python distribution](https://www.anaconda.com/download)
Expand All @@ -151,7 +146,6 @@ the following instructions and read carefully the [CONTRIBUTING](CONTRIBUTING.md
file before getting started.

### 1. Fork and clone the repository

Execute the following command in your terminal:

```
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
displayName: 'Install prerequisites and library'
- script: |
python setup.py test
pytest
condition: succeededOrFailed()
displayName: 'Run tests'
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
displayName: 'Install prerequisites and library'
- script: |
python setup.py test
pytest
condition: succeededOrFailed()
displayName: 'Run tests'
Binary file added docs/source/_static/pyproximal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/pyproximal_b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Non-Convex
Log1
QuadraticEnvelopeCard
QuadraticEnvelopeCardIndicator
RelaxedMumfordShah
SCAD


Expand Down
35 changes: 23 additions & 12 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
Changelog
=========

Version 0.7.0
--------------
*Released on: 10/11/2023*

* Added :py:class:`pyproximal.proximal.RelaxedMumfordShah`` operator
* Added cuda version to the proximal operator of :py:class:`pyproximal.proximal.Simplex`
* Added bilinear update to :py:func:`pyproximal.optimization.primal.ProximalGradient`
* Modified :py:func:`pyproximal.optimization.pnp.PlugAndPlay` function signature to allow using any proximal solver of choice
* Fixed print in :py:func:`pyproximal.optimization.primaldual.PrimalDual` when using cupy arrays
* Fixed :py:class:`pyproximal.utils.bilinear.LowRankFactorizedMatrix` when ``n=m``

Version 0.6.0
--------------
*Released on: 18/03/2023*
Expand All @@ -23,19 +34,19 @@ Version 0.5.0
|:vertical_traffic_light:| |:vertical_traffic_light:|

* Added :py:class:`pyproximal.proximal.Log1` operator
* Allow ``radius`` parameter of :py:class:`pyproximal.optimization.primal.L0` to be a function
* Allow ``tau`` parameter of :py:class:`pyproximal.optimization.primal.HQS` to be a vector
* Allow ``radius`` parameter of :py:func:`pyproximal.optimization.primal.L0` to be a function
* Allow ``tau`` parameter of :py:func:`pyproximal.optimization.primal.HQS` to be a vector
and change over iterations
* Added ``z0`` to :py:class:`pyproximal.optimization.primal.HQS`
* Added ``z0`` to :py:func:`pyproximal.optimization.primal.HQS`
* Added ``factorize`` option to ``densesolver`` of :py:class:`pyproximal.proximal.L2`

Version 0.4.0
--------------
*Released on: 05/06/2022*

* Added :py:class:`pyproximal.optimization.primal.ADMML2`,
:py:class:`pyproximal.optimization.primal.HQS`,
and :py:class:`pyproximal.optimization.pnp.PlugAndPlay` solvers
* Added :py:func:`pyproximal.optimization.primal.ADMML2`,
:py:func:`pyproximal.optimization.primal.HQS`,
and :py:func:`pyproximal.optimization.pnp.PlugAndPlay` solvers
* Added :py:class:`pyproximal.proximal.ETP`, :py:class:`pyproximal.proximal.Geman`,
:py:class:`pyproximal.proximal.L0`, :py:class:`pyproximal.proximal.Log`,
:py:class:`pyproximal.proximal.QuadraticEnvelopeCard`, :py:class:`pyproximal.proximal.SCAD`
Expand All @@ -47,8 +58,8 @@ Version 0.3.0
--------------
*Released on: 23/03/2022*

* Added :py:class:`pyproximal.optimization.palm.PALM` optimizer
* Added ``callback`` to :py:class:`pyproximal.optimization.primal.ProximalPoint`
* Added :py:func:`pyproximal.optimization.palm.PALM` optimizer
* Added ``callback`` to :py:func:`pyproximal.optimization.primal.ProximalPoint`
optimizer
* Added :py:class:`pyproximal.utils.bilinear.BilinearOperator`
and :py:class:`pyproximal.utils.bilinear.LowRankFactorizedMatrix`
Expand All @@ -67,11 +78,11 @@ Version 0.2.0
* Added
:py:class:`pyproximal.proximal.Nuclear`, and
:py:class:`pyproximal.proximal.NuclearBall` operators
* Added :py:class:`pyproximal.optimization.primal.TwIST` solver
* Added :py:func:`pyproximal.optimization.primal.TwIST` solver
* Added `acceleration` in
:py:class:`pyproximal.optimization.primal.AcceleratedProximalGradient` solver
:py:func:`pyproximal.optimization.primal.AcceleratedProximalGradient` solver
* Added classes standard deviation in
:py:class:`pyproximal.optimization.segmentation.Segment` solver
:py:func:`pyproximal.optimization.segmentation.Segment` solver
* Added `chain` method :py:class:`pyproximal.ProxOperator`
* Fix :py:class:`pyproximal.proximal.Orthogonal` by introducing `alpha`
in the proximal evaluation
Expand All @@ -81,7 +92,7 @@ Version 0.1.0
--------------
*Released on: 24/04/2021*

* Added :py:class:`pyproximal.optimization.sr3.SR3` solver
* Added :py:func:`pyproximal.optimization.sr3.SR3` solver
* Added :py:class:`pyproximal.projection.AffineSetProj` and
:py:class:`pyproximal.AffineSet` operators
* Fixed :py:class:`pyproximal.Huber` operator
Expand Down
10 changes: 7 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import sys
import os
import datetime
import sphinx_rtd_theme
import sphinx_gallery
from sphinx_gallery.sorting import ExampleTitleSortKey
from pyproximal import __version__
Expand Down Expand Up @@ -77,8 +76,9 @@

# 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 @@ -102,7 +102,7 @@
html_last_updated_fmt = '%b %d, %Y'
html_title = 'PyProximal'
html_short_title = 'PyProximal'
html_logo = 'pyproximal.png'
html_logo = '_static/pyproximal.png'
html_favicon = 'favicon.ico'
html_extra_path = []
pygments_style = 'default'
Expand All @@ -116,6 +116,10 @@
html_theme_options = {
'logo_only': True,
'display_version': True,
"logo": {
"image_light": "pyproximal_b.png",
"image_dark": "pyproximal.png",
}
}
html_context = {
'menu_links_name': 'Repository',
Expand Down
26 changes: 20 additions & 6 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,35 @@ is not just a pure stylistic choice but comes with some *hidden* advantages, suc
Step-by-step installation for users
-----------------------------------

Python environment
~~~~~~~~~~~~~~~~~~
Conda (recommended)
===================
If using ``conda``, install our ``conda-forge`` distribution via:

Activate your Python environment, and simply type the following command in your terminal
to install the PyPi distribution:
.. code-block:: bash
>> conda install --channel conda-forge pyproximal
Using the ``conda-forge`` distribution is recommended as all the dependencies (both required
and optional) will be automatically installed for you.

Pip
===
If you are using ``pip``, and simply type the following command in your terminal
to install the PyPI distribution:

.. code-block:: bash
>> pip install pyproximal
Alternatively, to access the latest source from github:
Note that when installing via ``pip``, only *required* dependencies are installed.

From Source
===========
To access the latest source from github:

.. code-block:: bash
>> pip install https://github.com/PyLops/pyproximal/archive/master.zip
>> pip install https://github.com/PyLops/pyproximal.git@main
or just clone the repository

Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
- bm3d
- pytest-runner
- setuptools_scm
- sphinx-rtd-theme
- pydata-sphinx-theme
- sphinx-gallery
- nbsphinx
- image
Expand Down
Loading

0 comments on commit 6befcf4

Please sign in to comment.