-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
99 changed files
with
5,974 additions
and
4,146 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,43 @@ | ||
name: Run tests and determine coverage | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
pull_request: | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 1 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install SyNCoPy | ||
run: | | ||
pip install -e .[dev] | ||
- name: Lint with flake8 | ||
run: | | ||
pip install flake8 | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# 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 | ||
- name: Test with pytest and get coverage | ||
run: | | ||
cd syncopy/tests | ||
pytest --color=yes --tb=short --verbose --cov=../../syncopy --cov-config=../../.coveragerc --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
name: syncopy-codecov | ||
verbose: 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
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
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 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,10 @@ | ||
|
||
# (Online-) Documentation | ||
|
||
## Build Requirements | ||
|
||
Install (debian based packages): | ||
- `sphinx-common` | ||
- `python3-sphinx-bootstrap-theme` | ||
|
||
then run `make html` from this folder |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,10 @@ a.reference.external{ | |
|
||
p.rubric { | ||
font-size: 16px; | ||
} | ||
} | ||
|
||
p { | ||
font-size: 1.1em | ||
} | ||
|
||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,19 @@ | ||
import numpy as np | ||
import syncopy as spy | ||
from syncopy.tests import synth_data | ||
|
||
nTrials = 50 | ||
nSamples = 1500 | ||
trls = [] | ||
# 2x2 Adjacency matrix to define coupling | ||
AdjMat = np.zeros((2, 2)) | ||
# coupling 0 -> 1 | ||
AdjMat[0, 1] = 0.2 | ||
|
||
for _ in range(nTrials): | ||
|
||
trl = synth_data.AR2_network(AdjMat, nSamples=nSamples) | ||
trls.append(trl) | ||
|
||
data = spy.AnalogData(trls, samplerate=500) | ||
spec = spy.freqanalysis(data, tapsmofrq=3, keeptrials=False) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,29 @@ | ||
import numpy as np | ||
import syncopy as spy | ||
|
||
|
||
nTrials = 50 | ||
nSamples = 1000 | ||
nChannels = 2 | ||
samplerate = 500 # in Hz | ||
|
||
# the sampling times vector needed for construction | ||
tvec = np.arange(nSamples) * 1 / samplerate | ||
# the 30Hz harmonic | ||
harm = np.cos(2 * np.pi * 30 * tvec) | ||
# dampening down to 10% of the original amplitude | ||
dampening = np.linspace(1, 0.1, nSamples) | ||
signal = dampening * harm | ||
|
||
# collect trials | ||
trials = [] | ||
for _ in range(nTrials): | ||
|
||
# start with the noise | ||
trial = np.random.randn(nSamples, nChannels) | ||
# now add the damped harmonic on the 1st channel | ||
trial[:, 0] += signal | ||
trials.append(trial) | ||
|
||
# instantiate Syncopy data object | ||
data = spy.AnalogData(trials, samplerate=samplerate) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.