Skip to content

Commit 3aa6b97

Browse files
committed
2 parents d880363 + f54de18 commit 3aa6b97

File tree

2 files changed

+18
-63
lines changed

2 files changed

+18
-63
lines changed

.travis.yml

Lines changed: 16 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,18 @@
1-
env:
2-
global:
3-
- PIPENV_VENV_IN_PROJECT=1
4-
- PIPENV_IGNORE_VIRTUALENVS=1
5-
6-
matrix:
7-
include:
8-
- os: linux
9-
sudo: required
10-
python: 2.7
11-
env: TEST_PYTHON_VERSION=2.7
12-
- os: linux
13-
sudo: required
14-
python: 3.5
15-
env: TEST_PYTHON_VERSION=3.5
16-
- os: linux
17-
sudo: required
18-
python: 3.6
19-
env: TEST_PYTHON_VERSION=3.6
20-
- os: osx
21-
language: generic
22-
env: TEST_PYTHON_VERSION=2.7
23-
- os: osx
24-
languageL: generic
25-
env: TEST_PYTHON_VERSION=3.5
26-
- os: osx
27-
language: generic
28-
env: TEST_PYTHON_VERSION=3.6
1+
language: python
2+
python:
3+
- '3.7'
4+
notifications:
5+
email: false
6+
before_install:
7+
- python --version
8+
- pip install -U cython setuptools pip numpy
299

3010
install:
31-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
32-
brew update;
33-
if [[ "$TEST_PYTHON_VERSION" == "2.7" ]]; then
34-
wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh;
35-
else
36-
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
37-
fi
38-
else
39-
sudo apt-get update;
40-
if [[ "$TEST_PYTHON_VERSION" == "2.7" ]]; then
41-
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
42-
else
43-
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
44-
fi
45-
fi
46-
- bash miniconda.sh -b -p $HOME/miniconda
47-
- export PATH="$HOME/miniconda/bin:$PATH"
48-
- hash -r
49-
- conda config --set always_yes yes --set changeps1 no
50-
- conda update -q conda
51-
- conda create -q -n test-environment python=$TEST_PYTHON_VERSION
52-
- source activate test-environment
53-
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$TEST_PYTHON_VERSION" == "2.7" ]]; then
54-
conda install virtualenv;
55-
fi
56-
- pip install pipenv
57-
- pipenv --update
58-
- pipenv --python ${TEST_PYTHON_VERSION}
59-
- pipenv install --dev
60-
- pipenv run pip install .
61-
62-
script:
63-
- pipenv run coverage run --source ecephys_spike_sorting -m pytest
64-
- pipenv run codecov
11+
- pip install .
12+
- pip install pytest-cov
13+
- pip install coveralls
14+
- pip install codecov
15+
script: pytest --cov=ecephys_spike_sorting tests/
16+
after_success:
17+
- codecov
18+
- coveralls

ecephys_spike_sorting/modules/quality_metrics/metrics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ def calculate_pc_metrics_one_cluster(cluster_peak_channels, idx, cluster_id,clus
270270

271271
all_pcs = np.reshape(all_pcs, (all_pcs.shape[0], pc_features.shape[1]*channels_to_use.size))
272272
if ((all_pcs.shape[0] > 10)
273-
and (cluster_id in all_labels)
273+
and not (all_labels == cluster_id).all() # Not all labels are this cluster
274+
and (sum(all_labels == cluster_id) > 20) # No fewer than 20 spikes in this cluster
274275
and (len(channels_to_use) > 0)):
275276
isolation_distance, l_ratio = mahalanobis_metrics(all_pcs, all_labels, cluster_id)
276277

0 commit comments

Comments
 (0)