Skip to content

Commit 2e5f8f4

Browse files
authored
Merge pull request #143 from asiaszmek/add_github_actions
Add GitHub actions
2 parents de7fd0c + 2a02ecc commit 2e5f8f4

58 files changed

Lines changed: 90 additions & 212 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.8", "3.9", "3.10", "3.11"]
20+
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v3
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
python -m pip install flake8 pytest
32+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
33+
34+
- name: Lint with flake8
35+
run: |
36+
# stop the build if there are Python syntax errors or undefined names
37+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
38+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
39+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
40+
- name: Test with pytest
41+
run: |
42+
pytest

.travis.yml

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

continuous_integration/install.sh

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

continuous_integration/readme

Whitespace-only changes.

continuous_integration/test_script.sh

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

figures/kCSD_properties/tutorial_basic_3d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def make_plots(fig_title,
7171
t_max = np.max(np.abs(true_csd))
7272
levels = np.linspace(-1*t_max, t_max, 16)
7373
ind_interest = np.mgrid[0:t_csd_z.shape[2]:np.complex(0,z_steps+2)]
74-
ind_interest = np.array(ind_interest, dtype=np.int)[1:-1]
74+
ind_interest = np.array(ind_interest, dtype=int)[1:-1]
7575
for ii, idx in enumerate(ind_interest):
7676
ax = plt.subplot(gs[ii, 0])
7777
im = plt.contourf(t_csd_x[:,:,idx], t_csd_y[:,:,idx], true_csd[:,:,idx],
@@ -131,7 +131,7 @@ def make_plots(fig_title,
131131
t_max = np.max(np.abs(pre_cv[:,:,:,0]))
132132
levels_kcsd = np.linspace(-1*t_max, t_max, 16)
133133
ind_interest = np.mgrid[0:k_csd_z.shape[2]:np.complex(0,z_steps+2)]
134-
ind_interest = np.array(ind_interest, dtype=np.int)[1:-1]
134+
ind_interest = np.array(ind_interest, dtype=int)[1:-1]
135135
for ii, idx in enumerate(ind_interest):
136136
ax = plt.subplot(gs[ii, 2])
137137
im = plt.contourf(k_csd_x[:,:,idx], k_csd_y[:,:,idx], pre_cv[:,:,idx,0],
@@ -159,7 +159,7 @@ def make_plots(fig_title,
159159
t_max = np.max(np.abs(est_csd[:,:,:,0]))
160160
levels_kcsd = np.linspace(-1*t_max, t_max, 16)
161161
ind_interest = np.mgrid[0:k_csd_z.shape[2]:np.complex(0,z_steps+2)]
162-
ind_interest = np.array(ind_interest, dtype=np.int)[1:-1]
162+
ind_interest = np.array(ind_interest, dtype=int)[1:-1]
163163
for ii, idx in enumerate(ind_interest):
164164
ax = plt.subplot(gs[ii, 3])
165165
im = plt.contourf(k_csd_x[:,:,idx], k_csd_y[:,:,idx], est_csd[:,:,idx,0],

figures/npx/Neuropixels_with_fitted_dipoles_model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
from pathlib import Path
12
import kCSD2D_reconstruction_from_npx as npx
23
import matplotlib.pyplot as plt
34
import matplotlib.cm as cm
45
import scipy
56
import numpy as np
7+
from numpy.linalg import LinAlgError
68
from scipy.signal import filtfilt, butter
7-
9+
import DemoReadSGLXData.readSGLX as readSGLX
810

911
def set_axis(ax, x, y, letter=None):
1012
ax.text(
@@ -198,4 +200,4 @@ def gauss2d(x, y, p):
198200
make_plot(ax4, k.estm_x, k.estm_y, projection.reshape(true_csd.shape), ele_pos,
199201
title='Projection', cmap='bwr')
200202
plt.tight_layout()
201-
plt.savefig('Neuropixels_with_fitted_model.png', dpi=300)
203+
plt.savefig('Neuropixels_with_fitted_model.png', dpi=300)

figures/npx/dan_kCSD_from_npx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def dan_fetch_electrodes(meta):
9393
def eles_to_rows(eles):
9494
rows = []
9595
for ele in eles:
96-
rows.append(np.int(np.ceil(ele/2)))
96+
rows.append(int(np.ceil(ele/2)))
9797
return rows
9898

9999
def eles_to_ycoord(eles):

figures/npx/map_npx_ele.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
def eles_to_rows(eles):
1111
rows = []
1212
for ele in eles:
13-
rows.append(np.int(np.ceil(ele/2)))
13+
rows.append(int(np.ceil(ele/2)))
1414
return rows
1515

1616
def eles_to_ycoord(eles):

figures/npx/map_npx_ele_Daniel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def eles_to_rows(eles):
99
rows = []
1010
for ele in eles:
11-
rows.append(np.int(np.ceil(ele/2)))
11+
rows.append(int(np.ceil(ele/2)))
1212
return rows
1313

1414
def eles_to_ycoord(eles):

0 commit comments

Comments
 (0)