Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into isort
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Oct 7, 2024
2 parents 9af5059 + 0295124 commit 8c2a77e
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 38 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/master-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,21 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install .[optional,doc]
- name: Build API documentation
run: |
python -m sphinx docs docs_build
run: make -C docs html

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'docs_build'
path: 'build'

- name: Deploy to GitHub Pages
id: deployment
Expand Down
26 changes: 25 additions & 1 deletion .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,33 @@ jobs:
- name: Set up Python "3.10"
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- uses: pre-commit/[email protected]

makedocs:
name: build documentation
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- 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
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install .[optional,doc]
- name: Build API documentation
run: make -C docs html


test-suite:
runs-on: ${{ matrix.os }}
needs: linter-check
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
.idea
*.log
sg_execution_times.rst
tmp/

*_cache/
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ A mathematical description of these methods is available in the documentation.
Installation
============

.. code::
$ pip install patch-denoise
patch-denoise requires Python>=3.9


Expand Down
8 changes: 6 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXOPTS ?= --verbose
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
SOURCEDIR =
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
Expand All @@ -14,6 +14,10 @@ help:

.PHONY: help Makefile

clean:
rm -fr build auto_examples _autosummary
rm -f sg_execution_times.rst

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
Expand Down
6 changes: 3 additions & 3 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ API Reference
=============

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

patch_denoise
21 changes: 16 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import sys
from importlib.metadata import version

sys.path.insert(0, os.path.abspath("../..")) # Source code dir relative to this file
sys.path.insert(0, os.path.abspath("..")) # Source code dir relative to this file

# -- Project information -----------------------------------------------------

Expand All @@ -43,7 +43,8 @@
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx_gallery.gen_gallery",
# "sphinx_gallery.gen_gallery",
"sphinxarg.ext",
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -52,8 +53,16 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
exclude_patterns = ["build", "Thumbs.db", ".DS_Store"]

_python_doc_base = "https://docs.python.org/3.9"

intersphinx_mapping = {
"python": (_python_doc_base, None),
"numpy": ("https://numpy.org/doc/stable/", None),
"scipy": ("https://scipy.github.io/devdocs/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
}

# generate autosummary even if no references
autosummary_generate = True
Expand All @@ -67,7 +76,9 @@
sphinx_gallery_conf = {
"examples_dirs": ["../examples/"],
"filename_pattern": "/example_",
"ignore_pattern": r"/(__init__|conftest)\.py",
"ignore_pattern": "conftest.py",
"example_extensions": {".py"},
"gallery_dirs": ["auto_examples"],
"reference_url": {
"numpy": "http://docs.scipy.org/doc/numpy-1.9.1",
"scipy": "http://docs.scipy.org/doc/scipy-0.17.0/reference",
Expand All @@ -86,5 +97,5 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_static_path = []
html_context = {"default_mode": "light"}
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@

api
denoisers
auto_examples/index
usage

.. auto_examples/index
6 changes: 3 additions & 3 deletions docs/usage.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#########################################
Using patch-denoise from the command line
#########################################
############
Command line
############

``patch-denoise`` minimally requires a path to a NIfTI file,
but it can take advantage of reconstructed phase data and/or noise volumes.
Expand Down
1 change: 0 additions & 1 deletion examples/__init__.py

This file was deleted.

14 changes: 0 additions & 14 deletions examples/example_experimental_data.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
"""
Experimental Data denoising
===========================
This is a example script to test various denoising methods on real-word fMRI data.
Source data should a sequence of 2D or 3D data, the temporal dimension being the last one.
The available denoising methods are "nordic", "mp-pca", "hybrid-pca", "opt-fro", "opt-nuc" and "opt-op".
"""

# %%
# Setup the parameters for the simulation and noise

SHAPE = (64, 64, 64)
N_FRAMES = 200

NOISE_LEVEL = 2
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ doc = [
"pydata-sphinx-theme",
"numpydoc",
"sphinx_gallery",
"sphinx-argparse",
"sphinx",
]

Expand Down
7 changes: 4 additions & 3 deletions src/patch_denoise/bindings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
3 Bindings are available:
* A `Nipype`<https://github.com/nipype/nipype/>_ binding
* A `Modopt`<https://cea-cosmic.github.io/ModOpt/index.html>_ binding
* A Command line interface, available as ``patch-denoise`` after installation.
- A `Nipype <https://github.com/nipype/nipype/>`_ binding
- A `Modopt <https://cea-cosmic.github.io/ModOpt/index.html>`_ binding
- A Command line interface, available as ``patch-denoise`` after installation.
"""
2 changes: 1 addition & 1 deletion src/patch_denoise/denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def hybrid_pca(
References
----------
.. [#]
https://submissions.mirasmart.com/ISMRM2022/Itinerary/Files/PDFFiles/2688.html
https://submissions.mirasmart.com/ISMRM2022/Itinerary/Files/PDFFiles/2688.html
See Also
--------
Expand Down

0 comments on commit 8c2a77e

Please sign in to comment.