Skip to content

Commit

Permalink
Added Travis CI setup, Coveralls, and badge to readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
josephhardinee committed Oct 29, 2015
1 parent b61f9df commit c9391b2
Show file tree
Hide file tree
Showing 7 changed files with 92 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]
omit=*setup.py
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
sudo: false

addons:
apt:
packages:
- gfortran
language: python
matrix:
include:
- python: "2.7"
env:
- PYTHON_VERSION="2.7"
- NOSE_ARGS="-v --no-skip --with-cov --cov pydisdrometer pydisdrometer"
- COVERALLS="true"

before_install:
- pip install pytest pytest-cov
- pip install coveralls
install: source continuous_integration/install.sh

script:
- nosetests $NOSE_ARGS
after_success:
- coveralls
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# PyDisdrometer

![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.9991.png)
[![Coverage Status](https://coveralls.io/repos/josephhardinee/PyDisdrometer/badge.svg?branch=master&service=github)](https://coveralls.io/github/josephhardinee/PyDisdrometer?branch=master)

PyDisdrometer is a Python package to process disdrometer files. It currently is capable of reading several different types of disdrometer formats, with more being added regularly. It can calculate several different moments of the distribution such as the median drop diamete, mu, and Dm. Additionally it can calculate radar parameters based on the T-Matrix scattering provided by pyTMatrix. It currently supports OTT Parsivel disdrometers, Joss Waldvogel Disdrometers, 2DVD files, and HVPS and 2DS airborne disdrometers. It is currently in alpha so functionality is limited but being expanded quickly.

Expand Down
57 changes: 57 additions & 0 deletions continuous_integration/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
# This script was adpated from the pyart install.sh script.
# This script is adapted from the install.sh script from the scikit-learn
# project: https://github.com/scikit-learn/scikit-learn

# This script is meant to be called by the "install" step defined in
# .travis.yml. See http://docs.travis-ci.com/ for more details.
# The behavior of the script is controlled by environment variabled defined
# in the .travis.yml in the top level folder of the project.

set -e
# use next line to debug this script
#set -x

# Use Miniconda to provide a Python environment. This allows us to perform
# a conda based install of the SciPy stack on multiple versions of Python
# as well as use conda and binstar to install additional modules which are not
# in the default repository.
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \
-O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b
export PATH=/home/travis/miniconda/bin:$PATH
conda update --yes conda
conda update --yes conda

# Create a testenv with the correct Python version
conda create -n testenv --yes pip python=$PYTHON_VERSION
source activate testenv

# Install dependencies
conda install --yes numpy scipy matplotlib netcdf4 nose

if [[ $PYTHON_VERSION == '2.7' ]]; then

conda install --yes sphinx numpydoc h5py
conda install --yes sphinx_rtd_theme
pip install sphinxcontrib-bibtex
pip install xmltodict
pip install pytmatrix
fi
if [[ $PYTHON_VERSION == '3.3' ]]; then
conda install --yes basemap
pip install pytmatrix
fi
if [[ $PYTHON_VERSION == '3.4' ]]; then
conda install --yes basemap
pip install pytmatrix
fi

# install coverage modules
pip install nose-cov
if [[ "$COVERALLS" == "true" ]]; then
pip install python-coveralls
fi

pip install -e .
2 changes: 1 addition & 1 deletion pydisdrometer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .ParsivelReader import read_parsivel
from .ParsivelReader import read_parsivel
from .ParsivelNasaGVReader import read_parsivel_nasa_gv
from .JWDReader import read_jwd
from .aux_readers.GPMApuWallopsRawReader import read_gpm_nasa_apu_raw_wallops
Expand Down
4 changes: 4 additions & 0 deletions pydisdrometer/tests/test_DSR.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import pydisdrometer

def test_tb():
assert pydisdrometer.DSR.tb(2) > 0
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
addopts = --ignore setup.py --cov-report term-missing --cov .

0 comments on commit c9391b2

Please sign in to comment.