Skip to content

Commit a00f491

Browse files
authored
Fix README layout (#32)
* Convert readme to md format * Clean up * Clean up * Remove rst version of readme * Update actions version * Attempt to fix workflow * Remove separate windows test workflow * Attempt to fix workflow
1 parent 9d10731 commit a00f491

File tree

6 files changed

+125
-220
lines changed

6 files changed

+125
-220
lines changed

.github/workflows/pypi_upload.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
name: Upload package to PyPI
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
with:
2020
submodules: recursive
2121
- name: Install Python 3
22-
uses: actions/setup-python@v1
22+
uses: actions/setup-python@v4
2323
with:
2424
python-version: 3.8
2525
- name: Install dependencies

.github/workflows/pytest.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,41 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ${{ matrix.os }}
13+
defaults:
14+
run:
15+
shell: bash -el {0}
1316
strategy:
1417
fail-fast: false
1518
matrix:
16-
python-version: [3.8, 3.9]
17-
# python-version: [3.8]
18-
# os: [ubuntu-latest, macOS-latest, windows-latest]
19-
os: [ubuntu-latest, macOS-latest]
19+
python-version: ["3.9", "3.10"]
20+
os: [ubuntu-latest, macOS-latest, windows-latest]
2021

2122
steps:
22-
- uses: actions/checkout@v2
23-
24-
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v1
23+
- uses: actions/checkout@v3
24+
- name: Set up conda environment
25+
uses: conda-incubator/setup-miniconda@v3
2626
with:
2727
python-version: ${{ matrix.python-version }}
28-
28+
auto-update-conda: true
29+
activate-environment: test-env
30+
auto-activate-base: false
31+
- name: Display environment details
32+
run: |
33+
conda info
2934
- name: Install dependencies
3035
run: |
31-
$CONDA/bin/conda config --env --append channels conda-forge
32-
$CONDA/bin/conda env update --file requirements.txt --name base
33-
$CONDA/bin/conda install pytest-cov
34-
$CONDA/bin/python -m pip install --upgrade pip
35-
$CONDA/bin/pip install -e .
36+
conda install -c conda-forge pytest pytest-cov
37+
conda install -c conda-forge pyfftw
38+
python -m pip install --upgrade pip
39+
pip install setuptools
40+
pip install -r requirements.txt
41+
pip install -e .
3642
- name: Unit tests
3743
run: |
38-
$CONDA/bin/pytest --cov=sporco --cov-report=xml
44+
pytest --cov=sporco --cov-report xml
3945
- name: Upload coverage to codecov
4046
if: matrix.os == 'ubuntu-latest'
41-
uses: codecov/codecov-action@v2
47+
uses: codecov/codecov-action@v3
4248
with:
4349
env_vars: OS,PYTHON
4450
fail_ci_if_error: false

.github/workflows/pytest_windows.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/sporco.svg)](https://github.com/bwohlberg/sporco)
2+
[![Package License](https://img.shields.io/github/license/bwohlberg/sporco.svg)](https://github.com/bwohlberg/sporco/blob/master/LICENSE)
3+
[![Documentation Status](https://readthedocs.org/projects/sporco/badge/?version=latest)](http://sporco.readthedocs.io/en/latest/?badge=latest)
4+
[![Test status](https://github.com/bwohlberg/sporco/actions/workflows/pytest.yml/badge.svg)](https://github.com/bwohlberg/sporco/actions/workflows/pytest.yml)
5+
[![Test Coverage](https://codecov.io/gh/bwohlberg/sporco/branch/master/graph/badge.svg)](https://codecov.io/gh/bwohlberg/sporco)\
6+
[![PyPi Release](https://badge.fury.io/py/sporco.svg)](https://badge.fury.io/py/sporco)
7+
[![PyPi Downloads](https://static.pepy.tech/personalized-badge/sporco?period=total&left_color=grey&right_color=brightgreen&left_text=downloads)](https://pepy.tech/project/sporco)
8+
[![Conda Forge Release](https://img.shields.io/conda/vn/conda-forge/sporco.svg)](https://anaconda.org/conda-forge/sporco)
9+
[![Conda Forge Downloads](https://img.shields.io/conda/dn/conda-forge/sporco.svg)](https://anaconda.org/conda-forge/sporco)\
10+
[![Binder](http://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/bwohlberg/sporco-notebooks/master?filepath=index.ipynb)
11+
[![DOI](https://img.shields.io/badge/DOI-10.25080%2Fshinma--7f4c6e7--001-blue.svg)](https://dx.doi.org/10.25080/shinma-7f4c6e7-001)
12+
13+
14+
# SParse Optimization Research COde (SPORCO)
15+
16+
SPORCO is a Python package for solving optimisation problems with sparsity-inducing regularisation. These consist primarily of sparse coding and dictionary learning problems, including convolutional sparse coding and dictionary learning, but there is also support for other problems such as Total Variation regularisation and Robust PCA. The optimisation algorithms in the current version are based on the Alternating Direction Method of Multipliers (ADMM) or on the Proximal Gradient Method (PGM).
17+
18+
If you use this software for published work, please [cite it](http://sporco.readthedocs.io/en/latest/overview.html#citing).
19+
20+
21+
# Documentation
22+
23+
[Documentation](http://sporco.rtfd.io/) is available online, or can be built from the root directory of the source distribution by the command
24+
25+
python setup.py build_sphinx
26+
27+
in which case the HTML documentation can be found in the `build/sphinx/html` directory (the top-level document is `index.html`). Although the SPORCO package itself is compatible with Python 3.x, building the documention requires Python 3.3 or later due to the use of [Jonga](https://github.com/bwohlberg/jonga) to construct call graph images for the SPORCO optimisation class hierarchies.
28+
29+
An overview of the package design and functionality is also available in
30+
31+
> Brendt Wohlberg, [SPORCO: A Python package for standard and convolutional sparse representations](http://conference.scipy.org/proceedings/scipy2017/brendt_wohlberg.html),
32+
> in Proceedings of the 15th Python in Science Conference, (Austin, TX, USA), doi:10.25080/shinma-7f4c6e7-001, pp. 1--8, Jul 2017
33+
34+
35+
# Usage
36+
37+
Scripts illustrating usage of the package can be found in the `examples` directory of the source distribution. These examples can be run from the root directory of the package by, for example
38+
39+
python examples/scripts/sc/bpdn.py
40+
41+
To run these scripts prior to installing the package it will be necessary to first set the `PYTHONPATH` environment variable to include the root directory of the package. For example, in a `bash` shell
42+
43+
export PYTHONPATH=$PYTHONPATH:`pwd`
44+
45+
from the root directory of the package.
46+
47+
[Jupyter Notebook](http://jupyter.org/) examples are also [available](https://github.com/bwohlberg/sporco-notebooks). These examples can be viewed online via [nbviewer](https://nbviewer.jupyter.org/github/bwohlberg/sporco-notebooks/blob/master/index.ipynb), or run interactively at [binder](https://mybinder.org/v2/gh/bwohlberg/sporco-notebooks/master?filepath=index.ipynb).
48+
49+
50+
# Requirements
51+
52+
The primary requirements are Python itself, and modules [future](http://python-future.org), [numpy](http://www.numpy.org), [scipy](https://www.scipy.org), [imageio](https://imageio.github.io/), [pyfftw](https://hgomersall.github.io/pyFFTW), and [matplotlib](http://matplotlib.org). Module [numexpr](https://github.com/pydata/numexpr) is not required, but some functions will be faster if it is installed. If module [mpldatacursor](https://github.com/joferkington/mpldatacursor) is installed, functions `plot.plot`, `plot.contour`, and `plot.imview` will support the data cursor that it provides.
53+
54+
Instructions for installing these requirements are provided in the [Requirements](http://sporco.rtfd.io/en/latest/install.html#requirements) section of the package documentation.
55+
56+
57+
# Installation
58+
59+
To install the most recent release of SPORCO from [PyPI](https://pypi.python.org/pypi/sporco/) do
60+
61+
pip install sporco
62+
63+
The [development version](https://github.com/bwohlberg/sporco) on GitHub can be installed by doing
64+
65+
pip install git+https://github.com/bwohlberg/sporco
66+
67+
or by doing
68+
69+
git clone https://github.com/bwohlberg/sporco.git
70+
71+
followed by
72+
73+
cd sporco
74+
python setup.py build
75+
python setup.py install
76+
77+
The install commands will usually have to be performed with root privileges.
78+
79+
SPORCO can also be installed as a [conda](https://conda.io/docs/) package from the [conda-forge](https://conda-forge.org/) channel
80+
81+
conda install -c conda-forge sporco
82+
83+
A summary of the most significant changes between SPORCO releases can be found in the `CHANGES.rst` file. It is strongly recommended to consult this summary when updating from a previous version.
84+
85+
86+
# Extensions
87+
88+
Some additional components of SPORCO are made available in separate repositories:
89+
90+
- [SPORCO-CUDA](https://github.com/bwohlberg/sporco-cuda):
91+
GPU-accelerated versions of selected convolutional sparse coding
92+
algorithms
93+
- [SPORCO Notebooks](https://github.com/bwohlberg/sporco-notebooks):
94+
Jupyter Notebook versions of the example scripts distributed with
95+
SPORCO
96+
- [SPORCO Extra](https://github.com/bwohlberg/sporco-extra):
97+
Additional examples, data, and contributed code
98+
99+
# License
100+
101+
SPORCO is distributed as open-source software under a BSD 3-Clause License (see the `LICENSE` file for details).

README.rst

Lines changed: 0 additions & 159 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ scipy>=0.19.1
44
imageio
55
matplotlib>=1.3.1
66
pyfftw>=0.10.4
7-
pytest-runner
87
pytest

0 commit comments

Comments
 (0)