-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #379 from cosanlab/ejolly/dev
Entire code base reformat with black. Added github workflow for ci. Drop Python 2 artifacts.
- Loading branch information
Showing
43 changed files
with
5,249 additions
and
3,437 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,85 @@ | ||
name: Deploy Docs and PyPI | ||
|
||
on: release | ||
|
||
jobs: | ||
# Job (1): Build and deploy docs. | ||
docs: | ||
if: "!contains(github.event.head_commit.message, 'skip ci')" | ||
name: Build & deploy docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Upgrade pip | ||
run: | | ||
# install pip=>20.1 to use "pip cache dir" | ||
python3 -m pip install --upgrade pip | ||
- name: Setup pip-cache | ||
id: pip-cache | ||
run: echo "::set-output name=dir::$(pip cache dir)" | ||
|
||
- name: Cache deps | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.pip-cache.outputs.dir }} | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install deps | ||
run: | | ||
python3 -m pip install . -r requirements.txt | ||
python3 -m pip install . -r requirements-dev.txt | ||
python3 -m pip install . -r optional-dependencies.txt | ||
- name: Build docs | ||
run: | | ||
cd docs | ||
make clean | ||
make html | ||
touch _build/html/.nojekyll | ||
- name: Deploy docs | ||
if: success() | ||
uses: crazy-max/ghaction-github-pages@v2 | ||
with: | ||
target_branch: gh-pages | ||
build_dir: docs/_build/html | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Job (2): Build package and upload to pypi | ||
deploy: | ||
if: "!contains(github.event.head_commit.message, 'skip ci')" | ||
name: Build & deploy package | ||
runs-on: ubuntu-latest | ||
needs: docs | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Pypa build | ||
run: | | ||
python3 -m pip install build --user | ||
- name: Wheel and source build | ||
run: | | ||
python3 -m build --sdist --wheel --outdir dist/ | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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
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
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
{ | ||
"recommendations": [ | ||
"kevinrose.vsc-python-indent", | ||
"njpwerner.autodocstring" | ||
] | ||
} |
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,11 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"python.testing.pytestEnabled": true, | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.nosetestsEnabled": false, | ||
"python.testing.pytestArgs": [ | ||
"nltools" | ||
], | ||
"python.testing.autoTestDiscoverOnSaveEnabled": true, | ||
"editor.insertSpaces": true | ||
} |
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,62 +1,39 @@ | ||
[![Package versioning](https://img.shields.io/pypi/v/nltools.svg)](https://pypi.org/project/nltools/) | ||
[![Build Status](https://api.travis-ci.org/cosanlab/nltools.png)](https://travis-ci.org/cosanlab/nltools/) | ||
[![Build Status](https://github.com/cosanlab/nltools/workflows/tests_and_coverage/badge.svg)] | ||
[![codecov](https://codecov.io/gh/cosanlab/nltools/branch/master/graph/badge.svg)](https://codecov.io/gh/cosanlab/nltools) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/625677967a0749299f38c2bf8ee269c3)](https://www.codacy.com/app/ljchang/nltools?utm_source=github.com&utm_medium=referral&utm_content=ljchang/nltools&utm_campaign=Badge_Grade) | ||
[![Documentation Status](https://readthedocs.org/projects/neurolearn/badge/?version=latest)](http://neurolearn.readthedocs.io/en/latest/?badge=latest) | ||
[![Documentation Status](https://github.com/cosanlab/nltools/workflows/deploy_docs_pypi_onrelease/badge.svg) | ||
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2229813.svg)](https://doi.org/10.5281/zenodo.2229813) | ||
![Python Versions](https://img.shields.io/badge/python-3.7%20%7C%203.8-blue) | ||
![Platforms](https://img.shields.io/badge/platform-linux%20%7C%20osx%20%7C%20win-blue) | ||
|
||
|
||
# NLTools | ||
Python toolbox for analyzing neuroimaging data. It is particularly useful for conducting multivariate analyses. It is originally based on Tor Wager's object oriented matlab [canlab core tools](http://wagerlab.colorado.edu/tools) and relies heavily on [nilearn](http://nilearn.github.io) and [scikit learn](http://scikit-learn.org/stable/index.html). Nltools is compatible with Python 3.6+. Python 2.7 was only supported through 0.3.11. We will no longer be supporting Python2 starting with version 0.3.12. | ||
Python toolbox for analyzing neuroimaging data. It is particularly useful for conducting multivariate analyses. It is originally based on Tor Wager's object oriented matlab [canlab core tools](http://wagerlab.colorado.edu/tools) and relies heavily on [nilearn](http://nilearn.github.io) and [scikit learn](http://scikit-learn.org/stable/index.html). Nltools is only compatible with Python 3.7+. | ||
|
||
### Installation | ||
1. Method 1 | ||
## Documentation | ||
|
||
Documentation and tutorials are available at https://nltools.org | ||
|
||
## Installation | ||
1. Method 1 (stable) | ||
|
||
``` | ||
pip install nltools | ||
``` | ||
|
||
2. Method 2 (Recommended) | ||
2. Method 2 (bleeding edge) | ||
|
||
``` | ||
pip install git+https://github.com/cosanlab/nltools | ||
``` | ||
|
||
3. Method 3 | ||
3. Method 3 (for development) | ||
|
||
``` | ||
git clone https://github.com/cosanlab/nltools | ||
python setup.py install | ||
``` | ||
or | ||
``` | ||
pip install -e 'path_to_github_directory' | ||
pip install -e nltools | ||
``` | ||
|
||
### Dependencies | ||
nltools requires several dependencies. All are available in pypi. Can use `pip install 'package'` | ||
- nibabel>=2.0.1 | ||
- scikit-learn>=0.19.1 | ||
- nilearn>=0.4 | ||
- pandas>=0.20 | ||
- numpy>=1.9 | ||
- seaborn>=0.7.0 | ||
- matplotlib>=2.1 | ||
- scipy | ||
- six | ||
- pynv | ||
- joblib | ||
|
||
### Optional Dependencies | ||
- mne | ||
- requests | ||
- networkx | ||
- ipywidgets >=5.2.2 | ||
|
||
### Documentation | ||
Current Documentation can be found at [readthedocs](http://neurolearn.readthedocs.org/en/latest). | ||
|
||
Please see our [tutorials](http://neurolearn.readthedocs.io/en/latest/auto_examples/index.html), which provide numerous examples for how to use the toolbox. | ||
|
||
### Preprocessing | ||
Please see our [cosanlab_preproc](https://github.com/cosanlab/cosanlab_preproc) library for nipype pipelines to perform preprocessing on neuroimaging data. | ||
## Preprocessing | ||
Nltools has minimal routines for pre-processing data. For more complete pre-processing pipelines please see our [cosanlab_preproc](https://github.com/cosanlab/cosanlab_preproc) library built with `nipype`. |
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
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
Oops, something went wrong.