Skip to content

Commit

Permalink
Clean up of codes with pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrava87 committed Jul 27, 2024
1 parent d4bfa37 commit e90ad91
Show file tree
Hide file tree
Showing 23 changed files with 1,060 additions and 1,200 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
pip install .
- name: Test with pytest
run: |
pytest
pytest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ spgl1.egg-info/
# Docs
docs/build/
docs/source/api/generated
docs/source/tutorials
docs/source/tutorials
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
exclude: "^docs/"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: # arguments to configure black
- --line-length=88

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args:
[
"--profile",
"black",
"--skip",
"__init__.py",
"--filter-files",
"--line-length=88",
]
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

504 changes: 0 additions & 504 deletions COPYING

This file was deleted.

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PIP := $(shell command -v pip3 2> /dev/null || command which pip 2> /dev/null)
PYTHON := $(shell command -v python3 2> /dev/null || command which python 2> /dev/null)

.PHONY: install dev-install install_conda dev-install_conda tests doc docupdate
.PHONY: install dev-install install_conda dev-install_conda tests doc docupdate servedoc

pipcheck:
ifndef PIP
Expand Down Expand Up @@ -39,3 +39,6 @@ doc:

docupdate:
cd docs && make html && cd ..

servedoc:
$(PYTHON) -m http.server --directory docs/build/html/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ It is designed to solve any of the following three problems:

2. Basis pursuit (BP):
``minimize ||x||_1 subject to Ax = b``

3. Lasso:
``minimize ||Ax - b||_2 subject to ||x||_1 <= tau``,

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = Pylops
SPHINXPROJ = Spgl1
SOURCEDIR = source
BUILDDIR = build

Expand Down
5 changes: 2 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import datetime
import sphinx_rtd_theme
import sphinx_gallery
from sphinx_gallery.sorting import ExampleTitleSortKey
from pkg_resources import get_distribution

Expand Down Expand Up @@ -75,6 +74,7 @@
templates_path = ['_templates']
exclude_patterns = ['_build', '**.ipynb_checkpoints']
source_suffix = '.rst'

# The encoding of source files.
source_encoding = 'utf-8-sig'
master_doc = 'index'
Expand Down Expand Up @@ -106,7 +106,6 @@
html_show_copyright = True

# Theme config
#html_theme = "alabaster"
html_theme = "sphinx_rtd_theme"
html_theme_options = {
'logo_only': True,
Expand All @@ -129,4 +128,4 @@

# Load the custom CSS files (needs sphinx >= 1.6 for this to work)
def setup(app):
app.add_stylesheet("style.css")
app.add_css_file("style.css")
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ where more appropriate implementation choices were identified for the Python pro
:hidden:

Installation <installation.rst>
Tutorials <tutorials/index.rst>
Reference documentation <api/index.rst>
Credits <credits.rst>

Expand Down
8 changes: 7 additions & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ channels:
- conda-forge
dependencies:
- python>=3.6.4
- pip
- numpy>=1.15.0
- scipy
- matplotlib
Expand All @@ -12,10 +13,15 @@ dependencies:
- pytest
- Sphinx
- numpydoc
- pre-commit
- autopep8
- isort
- black
- pip:
- pytest-runner
- setuptools_scm
- sphinx-rtd-theme
- sphinx-gallery
- nbsphinx
- image
- image
- flake8
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ channels:
- defaults
dependencies:
- python>=3.6.4
- pip
- numpy>=1.15.0
- scipy
Loading

0 comments on commit e90ad91

Please sign in to comment.