-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring for packaging and tests (#1)
* refactoring for packaging and tests * added CI for testing and packaging
- Loading branch information
Showing
113 changed files
with
23,844 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Python package | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.7', '3.8'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --builtins=snakemake | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --builtins=snakemake | ||
- name: Test with pytest | ||
run: | | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflows will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
recursive-include denoise_fmri/resources * | ||
recursive-include denoise_fmri/config * | ||
recursive-include denoise_fmri/workflow * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# snakebids app for denoising fmriprep output | ||
denoise-fmri | ||
============ | ||
|
||
Known issues: | ||
- pybids has an incompatibility with the latest fmriprep (20.2.0) dataset_description.json, need to replace this with the version in resources/dataset_description.json for now |
Empty file.
Binary file not shown.
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"Name": "denoise_fmri - BIDS app for denoising fmriprep outputs", | ||
"BIDSVersion": "1.4.0", | ||
"DatasetType": "derivative", | ||
"GeneratedBy": [ | ||
{ | ||
"Name": "denoise_fmri", | ||
"Version": "0.1.0", | ||
"CodeURL": "http://github.com/akhanf/denoise-fmri", | ||
"Author": "Ali Khan", | ||
"AuthorEmail": "[email protected]" | ||
|
||
} | ||
] | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
# | ||
# import os | ||
# import sys | ||
# sys.path.insert(0, os.path.abspath('.')) | ||
import sphinx_rtd_theme | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
|
||
project = 'app_name' | ||
copyright = '2020, Authors here' | ||
author = 'Authors here' | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
"sphinx_rtd_theme", | ||
"sphinxarg.ext", | ||
] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ['_templates'] | ||
|
||
# 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'] | ||
|
||
|
||
master_doc = 'index' | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = "sphinx_rtd_theme" | ||
|
||
# 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'] | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Installation | ||
============ | ||
|
||
Template snakebids BIDS App | ||
|
||
|
||
Requirements | ||
------------ | ||
|
||
Docker (Mac/Windows/Linux) or Singularity (Linux) | ||
|
||
Docker: | ||
^^^^^^^ | ||
|
||
Pull the container: | ||
|
||
.. code-block:: | ||
docker pull khanlab/app_name:latest | ||
do a dry run, printing the command at each step: | ||
|
||
.. code-block:: | ||
docker run -it --rm -v PATH_TO_BIDS_DIR:/bids:ro -v PATH_TO_OUTPUT_DIR:/output khanlab/app_name:latest /bids /output participant -np | ||
run it with maximum number of cores: | ||
|
||
.. code-block:: | ||
docker run -it --rm -v PATH_TO_BIDS_DIR:/bids:ro -v PATH_TO_OUTPUT_DIR:/output khanlab/app_name:latest /bids /output participant -p --cores all | ||
Singularity: | ||
^^^^^^^^^^^^ | ||
|
||
Pull the container: | ||
|
||
.. code-block:: | ||
singularity pull khanlab_app_name_latest.sif docker://khanlab/app_name:latest | ||
do a dry run, printing the command at each step: | ||
|
||
.. code-block:: | ||
singularity run -e khanlab_app_name_latest.sif khanlab/app_name:latest PATH_TO_BIDS_DIR PATH_TO_OUTPUT_DIR participant -np | ||
run it with maximum number of cores: | ||
|
||
.. code-block:: | ||
singularity run -e khanlab_app_name_latest.sif khanlab/app_name:latest PATH_TO_BIDS_DIR PATH_TO_OUTPUT_DIR participant -p --cores all | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. hippunfold documentation master file, created by | ||
sphinx-quickstart on Thu Jul 30 10:15:34 2020. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
.. include:: ../README.rst | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Contents: | ||
|
||
|
||
.. toctree:: | ||
:caption: Getting started | ||
:name: getting_started | ||
:hidden: | ||
:maxdepth: 1 | ||
|
||
getting_started/installation | ||
|
||
.. toctree:: | ||
:caption: Usage | ||
:name: usage | ||
:hidden: | ||
:maxdepth: 1 | ||
|
||
usage/app_cli | ||
usage/snakemake_cli | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sphinx-argparse | ||
sphinx_rtd_theme | ||
snakebids==0.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Command line interface | ||
-------------------- | ||
|
||
.. argparse:: | ||
:filename: ../app_name/run.py | ||
:func: get_parser | ||
:prog: hippunfold | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Snakemake Command line interface | ||
________________________________ | ||
|
||
.. argparse:: | ||
:module: snakemake | ||
:func: get_argument_parser | ||
:prog: snakemake | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
amply==0.1.4 | ||
appdirs==1.4.4 | ||
attrs==20.3.0 | ||
bids-validator==1.5.8 | ||
certifi==2020.12.5 | ||
chardet==3.0.4 | ||
click==7.1.2 | ||
ConfigArgParse==1.2.3 | ||
datrie==0.8.2 | ||
docopt==0.6.2 | ||
docutils==0.16 | ||
gitdb==4.0.5 | ||
GitPython==3.1.11 | ||
idna==2.10 | ||
ipython-genutils==0.2.0 | ||
joblib==1.0.0 | ||
jsonschema==3.2.0 | ||
jupyter-core==4.7.0 | ||
nbformat==5.0.8 | ||
nibabel==3.2.1 | ||
nilearn==0.7.0 | ||
num2words==0.5.10 | ||
numpy==1.19.4 | ||
packaging==20.8 | ||
pandas==1.1.5 | ||
patsy==0.5.1 | ||
psutil==5.7.3 | ||
PuLP==2.3.1 | ||
pybids==0.12.3 | ||
pyparsing==2.4.7 | ||
pyrsistent==0.17.3 | ||
python-dateutil==2.8.1 | ||
pytz==2020.4 | ||
PyYAML==5.3.1 | ||
ratelimiter==1.2.0.post0 | ||
requests==2.25.0 | ||
scikit-learn==0.23.2 | ||
scipy==1.5.4 | ||
six==1.15.0 | ||
smmap==3.0.4 | ||
snakebids==0.2.0 | ||
snakemake==5.30.1 | ||
SQLAlchemy==1.3.20 | ||
threadpoolctl==2.1.0 | ||
toposort==1.5 | ||
traitlets==5.0.5 | ||
urllib3==1.26.2 | ||
wrapt==1.12.1 |
Oops, something went wrong.