diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..58c9d21 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,2 @@ +[run] +omit=*setup.py diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8477f8d --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/README.md b/README.md index e7db26e..a735c49 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh new file mode 100644 index 0000000..9b5b596 --- /dev/null +++ b/continuous_integration/install.sh @@ -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 . diff --git a/pydisdrometer/__init__.py b/pydisdrometer/__init__.py index de4ee59..53e5a0e 100644 --- a/pydisdrometer/__init__.py +++ b/pydisdrometer/__init__.py @@ -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 diff --git a/pydisdrometer/tests/test_DSR.py b/pydisdrometer/tests/test_DSR.py new file mode 100644 index 0000000..3263c09 --- /dev/null +++ b/pydisdrometer/tests/test_DSR.py @@ -0,0 +1,4 @@ +import pydisdrometer + +def test_tb(): + assert pydisdrometer.DSR.tb(2) > 0 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..958ba31 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[pytest] +addopts = --ignore setup.py --cov-report term-missing --cov . +