QC service for checking data for and from OBIS
Source on GitHub at iobis/qc-service
There are two endpoints: outlierstaxon and outliersdatasets.
The following parameters are GET request:
- x: longitude of the points
- y: latitude of the points
- mad_coef (optional): Coefficient to multiply the median absolute deviation (MAD) by in order to determine the range of valid values (default is 6)
- iqr_coef (optional): Coefficient to multiply the interquartile range (IQR) by in order to determine the range of valid values (default is 3)
- aphiaid (optional): Taxonomic identifier as provided by the world register of marine species (WoRMS), this is parameter is only used by the outlierstaxon endpoint
- returnvalues (optional): Return the values based on which the outlier analysis is done (default is false).
For a POST request a json or msgpack object with the following attributes is expected:
- points: nested list of longitude/latitude pairs
- mad_coef (optional): Coefficient to multiply the median absolute deviation (MAD) by in order to determine the range of valid values (default is 6)
- iqr_coef (optional): Coefficient to multiply the interquartile range (IQR) by in order to determine the range of valid values (default is 3)
- aphiaid (optional): taxonomic identifier as provided by the world register of marine species (WoRMS), this is parameter is only used by the outlierstaxon endpoint
- returnvalues (optional): Return the values based on which the outlier analysis is done (default is false).
pipenv --three
pipenv install tox
pipenv install nose
pipenv install requests
pipenv install pandas
pipenv install json-logging-py
pipenv install gunicorn
pipenv install sphinx sphinx-autobuild sphinx_rtd_theme
pipenv install git+https://github.com/iobis/pyxylookup.git#egg=pyxylookup
# enter virtual environment
pipenv shell
Run tests
pipenv run nosetests --with-coverage --cover-package=service
Run locally
pipenv run gunicorn service.app:api
Call locally
- (Optional) generate requirements.txt
pipenv lock -r > requirements.txt
And remove git+https://github.com/iobis/pyxylookup.git#egg=pyxylookup from it.
- Use docker-compose or build and start
docker-compose up
Alternative is to build and start the Docker image
docker build -t qc-service .
docker run -e GUNICORN_WORKERS=4 -e GUNICORN_ACCESSLOG=- -p 8000:8000 qc-service
- Configure the two endpoints (outlierstaxon and outliersdataset) in NGINX
- License: MIT, see LICENSE file