Skip to content

Commit

Permalink
Merge pull request #15 from fabiansinz/master
Browse files Browse the repository at this point in the history
lgtm
  • Loading branch information
jgrewe committed Feb 5, 2016
2 parents 66e6873 + 33855c8 commit b4dd537
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
source = thunderfish
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: b2SXUJqkxFFdvCWzQEHqCWS4Rxh5tUgAo
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
sudo: false

language: python

python:
- 2.7

addons:
apt:
packages:
- python-numpy
- python-scipy
- python-matplotlib
- python-pandas
- python-tk

virtualenv:
system_site_packages: true

install:
- pip install git+https://github.com/G-Node/python-odml.git
- pip install -r requirements.txt
- pip install nose nose-cov python-coveralls
# command to run tests
script:
- nosetests -vv --with-coverage --cover-package=thunderfish

after_success:
- coveralls
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![Build Status](https://travis-ci.org/bendalab/thunderfish.svg?branch=master)](https://travis-ci.org/bendalab/thunderfish)
[![Coverage Status](https://coveralls.io/repos/github/bendalab/thunderfish/badge.svg?branch=master)](https://coveralls.io/github/bendalab/thunderfish?branch=master)

# thunderfish

this project is meant to analyze transects, segregate fishes in wave or pulse type fishes
Expand Down
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
numpy
matplotlib
scipy
seaborn
ipython
audioread
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from distutils.core import setup
from setuptools import find_packages

setup(name='thunderfish',
version='0.5',
packages=['thunderfish'],
packages=find_packages(exclude=['contrib', 'doc', 'tests*']),
description='Python scripts for analyzing recordings of e-fish electric fields.',
author='Juan F. Sehuanes, Till Raab, Fabian Sinz, Jan Benda, Joerg Henninger, Jan Grewe',
requires=['matplotlib', 'numpy', 'scipy', 'seaborn', 'IPython', 'audioread']
Expand Down
17 changes: 17 additions & 0 deletions tests/test_auxiliary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import numpy as np
from nose.tools import assert_true

from thunderfish.Auxiliary import peakdet


def test_peakdet():
"""Tests whether peakdet works corretly"""
x = np.zeros(1000)
peaks = np.random.randint(0,len(x), size=20)
peaks.sort()
while np.any(np.diff(peaks).min() < 2):
peaks = np.random.randint(0,len(x), size=20)
peaks.sort()
x[peaks] = 5
maxtab, maxidx, _, _ = peakdet(x, 2)
assert_true(np.all(maxidx == peaks), "Peaks were not detected correctly")

0 comments on commit b4dd537

Please sign in to comment.