Skip to content

Commit e8fabe9

Browse files
authored
Merge pull request #91 from rmarkello/corrnan
[ENH] Updates stats.efficient_pearsonr to handle NaNs
2 parents 38add68 + b6626a3 commit e8fabe9

21 files changed

+292
-318
lines changed

.github/workflows/tests.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: netneurotools tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
check_skip:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
skip: ${{ steps.result_step.outputs.ci-skip }}
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
- id: result_step
15+
uses: mstachniuk/ci-skip@master
16+
with:
17+
commit-filter: '[skip ci];[ci skip];[skip github]'
18+
commit-filter-separator: ';'
19+
20+
checks:
21+
needs: check_skip
22+
if: ${{ needs.check_skip.outputs.skip == 'false' }}
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
matrix:
26+
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
27+
python-version: ['3.6', '3.7', '3.8', '3.9']
28+
install: ['setup']
29+
check: ['test']
30+
optional-depends: ['']
31+
include:
32+
- os: ubuntu-latest
33+
python-version: 3.8
34+
install: setup
35+
check: style
36+
optional-depends: ''
37+
- os: ubuntu-latest
38+
python-version: 3.8
39+
install: setup
40+
check: doc
41+
optional-depends: ''
42+
- os: ubuntu-latest
43+
python-version: 3.8
44+
install: setup
45+
check: test
46+
optional-depends: numba
47+
- os: ubuntu-latest
48+
python-version: 3.8
49+
install: sdist
50+
check: test
51+
optional-depends: ''
52+
- os: ubuntu-latest
53+
python-version: 3.8
54+
install: bdist_wheel
55+
check: test
56+
optional-depends: ''
57+
exclude:
58+
- os: ubuntu-latest
59+
architecture: x86
60+
- os: macos-latest
61+
architecture: x86
62+
env:
63+
INSTALL_TYPE: ${{ matrix.install }}
64+
CHECK_TYPE: ${{ matrix.check }}
65+
OPTIONAL_DEPENDS: ${{ matrix.optional-depends }}
66+
steps:
67+
- uses: actions/checkout@v2
68+
with:
69+
submodules: recursive
70+
fetch-depth: 0
71+
- name: Set up Python ${{ matrix.python-version }}
72+
uses: actions/setup-python@v2
73+
with:
74+
python-version: ${{ matrix.python-version }}
75+
- name: 'Display Python version'
76+
run: python -c "import sys; print(sys.version)"
77+
- name: 'Install dependencies'
78+
run: ./tools/install_dependencies.sh
79+
- name: 'Install netneurotools'
80+
run: ./tools/install_package.sh
81+
- name: 'Run tests'
82+
run: ./tools/run_checks.sh
83+
- uses: codecov/codecov-action@v1
84+
with:
85+
file: for_testing/coverage.xml
86+
if: ${{ always() }}
87+
- name: Upload pytest test results
88+
uses: actions/upload-artifact@v2
89+
with:
90+
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
91+
path: for_testing/test-results.xml
92+
if: ${{ always() && matrix.check == 'test' }}

.travis.yml

Lines changed: 12 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,31 @@
1-
language: python
21
os: linux
2+
arch: arm64
33
dist: xenial
4+
language: python
5+
cache: pip
46
notifications:
57
email: change
68

79
python:
810
- 3.6
911
- 3.7
12+
- 3.8
13+
- 3.9
1014

1115
env:
12-
jobs:
13-
- CHECK_TYPE=linting
14-
- CHECK_TYPE=docdoctest
15-
- CHECK_TYPE=test
16-
- CHECK_TYPE=test INSTALL_NUMBA=true
1716
global:
18-
- INSTALL_TYPE=setup
19-
20-
jobs:
21-
include:
22-
- python: 3.6
23-
env:
24-
- INSTALL_TYPE=sdist
25-
- CHECK_TYPE=test
26-
- python: 3.6
27-
env:
28-
- INSTALL_TYPE=wheel
29-
- CHECK_TYPE=test
30-
- python: 3.6
31-
env:
32-
- INSTALL_TYPE=conda
33-
- CHECK_TYPE=test
17+
- INSTALL_TYPE="setup"
18+
- CHECK_TYPE="test"
19+
- OPTIONAL_DEPENDS=
3420

3521
before_install:
36-
- python -m pip install --upgrade pip
37-
- if [ "${INSTALL_TYPE}" == "conda" ]; then
38-
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
39-
bash miniconda.sh -b -p $HOME/miniconda;
40-
export PATH="$HOME/miniconda/bin:$PATH";
41-
hash -r;
42-
conda config --set always_yes yes --set changeps1 no;
43-
conda update -q conda;
44-
conda env create -f environment.yml;
45-
source activate netneurotools;
46-
fi
47-
- if [ "${CHECK_TYPE}" == "linting" ]; then
48-
pip install flake8;
49-
fi
50-
- if [ "${CHECK_TYPE}" == "test" ]; then
51-
pip install "pytest>=4.6" pytest-cov coverage codecov;
52-
fi
53-
- if [ ! -z "${INSTALL_NUMBA}"]; then
54-
pip install numba;
55-
fi
22+
- travis_retry tools/install_dependencies.sh
5623

5724
install:
58-
- |
59-
if [ "${INSTALL_TYPE}" == "setup" ]; then
60-
python setup.py install;
61-
elif [ "${INSTALL_TYPE}" == "sdist" ]; then
62-
python setup.py sdist;
63-
pip install dist/*.tar.gz;
64-
elif [ "${INSTALL_TYPE}" == "wheel" ]; then
65-
python setup.py bdist_wheel;
66-
pip install dist/*.whl;
67-
elif [ "${INSTALL_TYPE}" == "conda" ]; then
68-
pip install --no-deps .;
69-
else
70-
false;
71-
fi
25+
- travis_retry tools/install_package.sh
7226

7327
script:
74-
- |
75-
if [ "${CHECK_TYPE}" == "linting" ]; then
76-
flake8 netneurotools;
77-
elif [ "${CHECK_TYPE}" == "docdoctest" ]; then
78-
cd docs;
79-
pip install -r ./requirements.txt;
80-
make html;
81-
make doctest;
82-
elif [ "${CHECK_TYPE}" == "test" ]; then
83-
py.test --doctest-modules --cov-report term-missing --cov=netneurotools netneurotools;
84-
else
85-
false;
86-
fi
28+
- tools/run_checks.sh
8729

8830
after_success:
89-
# codecov with numba installed doesn't make sense, so don't do that
90-
- if [ "${CHECK_TYPE}" == "test" ] && [ -z "${INSTALL_NUMBA}" ]; then
91-
codecov;
92-
fi
93-
31+
- travis_retry python -m pip install codecov

MANIFEST.in

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
include README.md LICENSE environment.yml
2-
recursive-include netneurotools_matlab *.m
3-
recursive-include netneurotools data/*
4-
1+
include README.rst LICENSE environment.yml requirements.txt
2+
recursive-include netneurotools/data *
53
include versioneer.py
6-
include netneurotools/_version.py

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
netneurotools: Tools for network neuroscience
22
=============================================
33

4-
This toolbox is a collection of functions written in Python (and some Matlab!)
5-
that get frequent usage in the `Network Neuroscience Lab <www.misiclab.com>`_,
6-
housed in the `Brain Imaging Centre <https://www.mcgill.ca/bic/home>`_ at
4+
This toolbox is a collection of functions written in Python that get frequent
5+
usage in the `Network Neuroscience Lab <netneurolab.github.io/>`_, housed in
6+
the `Brain Imaging Centre <https://www.mcgill.ca/bic/home>`_ at
77
`McGill University <https://www.mcgill.ca/>`_.
88

99
.. image:: https://travis-ci.org/netneurolab/netneurotools.svg?branch=master

dev_environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- "pytest>=3.6"
1717
- pytest-cov
1818
- scikit-learn
19-
- scipy
19+
- "scipy>=1.4.0"
2020
- "sphinx>=1.2"
2121
- sphinx-gallery
2222
- sphinx_rtd_theme

docs/installation.rst

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,10 @@ running the following:
1616
1717
git clone https://github.com/netneurolab/netneurotools.git
1818
cd netneurotools
19-
python setup.py install
19+
pip install .
2020
2121
Alternatively, you can install ``netneurotools`` directly from PyPi with:
2222

2323
.. code-block:: bash
2424
2525
pip install netneurotools
26-
27-
.. _matlab_installation:
28-
29-
Matlab installation
30-
-------------------
31-
32-
The Matlab functions should work on R2012B or later (though that is an estimate
33-
based on the versions of Matlab that were around when the code was written).
34-
35-
To use the Matlab functions, download the repository and add the
36-
`netneurotools_matlab` directory to your Matlab path.

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- python==3.7
6+
- python>=3.6
77
- matplotlib
88
- nibabel
99
- nilearn
1010
- "numpy>=1.16"
1111
- pip
1212
- scikit-learn
13-
- scipy
13+
- "scipy>=1.4.0"
1414
- pip:
1515
- git+https://github.com/aestrivex/bctpy.git#egg=bctpy

netneurotools/__init__.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
__all__ = [
2-
'__author__', '__description__', '__email__', '__license__',
3-
'__maintainer__', '__packagename__', '__url__', '__version__',
2+
'__version__',
43
]
54

65
from ._version import get_versions
76
__version__ = get_versions()['version']
87
del get_versions
9-
10-
from .info import (
11-
__author__,
12-
__description__,
13-
__email__,
14-
__license__,
15-
__maintainer__,
16-
__packagename__,
17-
__url__,
18-
)

netneurotools/info.py

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

netneurotools/modularity.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ def zrand(X, Y):
113113
z_rand : float
114114
Z-rand index
115115
116-
See Also
117-
--------
118-
netneurotools_matlab/randz.m
119-
120116
References
121117
----------
122118
Amanda L. Traud, Eric D. Kelsic, Peter J. Mucha, and Mason A. Porter.

0 commit comments

Comments
 (0)