Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Python package

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.5, 3.6, 3.7]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install meegkit
run: |
pip install -e .
- name: Lint with flake8
run: |
make pep
- name: Test with pytest
run: |
pytest --cov=meegkit --cov-report=xml tests/
- name: Upload coverage to Codecov
# token: ${{secrets.CODECOV_TOKEN}}
run: bash <(curl -s https://codecov.io/bash)
28 changes: 5 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,9 @@ python:
- "3.7"
install:
- sudo apt-get update
# We do this conditionally because it saves us some downloading if the
# version is the same.
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda

- export DISPLAY=:99.0
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset
# Useful for debugging any issues with conda
- conda info -a
- conda env create -f environment.yml
- source activate meegkit
- python setup.py develop
- pip install -r requirements.txt
- pip install -e .
script: make pep
script: pytest --cov=meegkit tests/
after_success:
- bash <(curl -s https://codecov.io/bash)
script: pytest tests/ --cov=meegkit --cov-report=xml
# after_success:
# - bash <(curl -s https://codecov.io/bash)
21 changes: 0 additions & 21 deletions environment.yml

This file was deleted.

12 changes: 8 additions & 4 deletions meegkit/utils/sig.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# coding: utf-8
"""Signal processing tools."""
from __future__ import absolute_import, division, print_function

Expand Down Expand Up @@ -53,10 +54,13 @@ def modulation_index(phase, amp, n_bins=18):
time series can be constructed by cutting the amplitude time series at a
random time point and reversing the order of both parts [2]_. The observed
coupling value is standardized to the distribution of the shuffled coupling
values according to the following formula: MI_z = (MI_observed −
µ_MI_shuffled) / σ_MI_shuffled, where μ denotes the mean and σ the standard
deviation. Only when the observed phase-locking value is larger than 95 %
of shuffled values, it is defined as significant. See [2]_ for details.
values according to the following formula:

MI_z = (MI_observed − µ_MI_shuffled) / σ_MI_shuffled

where μ denotes the mean and σ the standard deviation. Only when the
observed phase-locking value is larger than 95 % of shuffled values, it is
defined as significant. See [2]_ for details.

References
----------
Expand Down
14 changes: 14 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
numpy
scipy
matplotlib
scikit-learn
sphinx
joblib
numpydoc
flake8
pytest
pytest-cov
codecov
codespell
pydocstyle
tqdm