diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc2abf4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,117 @@ +#.gitignore for Python, from gitHub + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ diff --git a/.travis.yml b/.travis.yml index 2f58de1..6931624 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,6 @@ install: - "pip install -r requirements.txt" - python setup.py install script: - - make test + - pytest --pyargs hrds #after_success: # - coveralls #--config_file .coveragerc diff --git a/hrds/__init__.py b/hrds/__init__.py index 7be55c8..bde9b4f 100644 --- a/hrds/__init__.py +++ b/hrds/__init__.py @@ -24,6 +24,8 @@ """ +__version__ = "0.1.0" + from .raster import RasterInterpolator # NOQA from .raster_buffer import CreateBuffer # NOQA from .hrds import HRDS # NOQA diff --git a/tests/__init__.py b/hrds/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to hrds/tests/__init__.py diff --git a/tests/base.tif b/hrds/tests/base.tif similarity index 100% rename from tests/base.tif rename to hrds/tests/base.tif diff --git a/tests/layer1.tif b/hrds/tests/layer1.tif similarity index 100% rename from tests/layer1.tif rename to hrds/tests/layer1.tif diff --git a/tests/layer2.tif b/hrds/tests/layer2.tif similarity index 100% rename from tests/layer2.tif rename to hrds/tests/layer2.tif diff --git a/tests/real_data/boundaries.dbf b/hrds/tests/real_data/boundaries.dbf similarity index 100% rename from tests/real_data/boundaries.dbf rename to hrds/tests/real_data/boundaries.dbf diff --git a/tests/real_data/boundaries.prj b/hrds/tests/real_data/boundaries.prj similarity index 100% rename from tests/real_data/boundaries.prj rename to hrds/tests/real_data/boundaries.prj diff --git a/tests/real_data/boundaries.qpj b/hrds/tests/real_data/boundaries.qpj similarity index 100% rename from tests/real_data/boundaries.qpj rename to hrds/tests/real_data/boundaries.qpj diff --git a/tests/real_data/boundaries.shp b/hrds/tests/real_data/boundaries.shp similarity index 100% rename from tests/real_data/boundaries.shp rename to hrds/tests/real_data/boundaries.shp diff --git a/tests/real_data/boundaries.shx b/hrds/tests/real_data/boundaries.shx similarity index 100% rename from tests/real_data/boundaries.shx rename to hrds/tests/real_data/boundaries.shx diff --git a/tests/real_data/create_bathy.py b/hrds/tests/real_data/create_bathy.py similarity index 100% rename from tests/real_data/create_bathy.py rename to hrds/tests/real_data/create_bathy.py diff --git a/tests/real_data/distance.fld b/hrds/tests/real_data/distance.fld similarity index 100% rename from tests/real_data/distance.fld rename to hrds/tests/real_data/distance.fld diff --git a/tests/real_data/emod_utm.tif b/hrds/tests/real_data/emod_utm.tif similarity index 100% rename from tests/real_data/emod_utm.tif rename to hrds/tests/real_data/emod_utm.tif diff --git a/tests/real_data/gebco_uk.tif b/hrds/tests/real_data/gebco_uk.tif similarity index 100% rename from tests/real_data/gebco_uk.tif rename to hrds/tests/real_data/gebco_uk.tif diff --git a/tests/real_data/high_res_area.dbf b/hrds/tests/real_data/high_res_area.dbf similarity index 100% rename from tests/real_data/high_res_area.dbf rename to hrds/tests/real_data/high_res_area.dbf diff --git a/tests/real_data/high_res_area.prj b/hrds/tests/real_data/high_res_area.prj similarity index 100% rename from tests/real_data/high_res_area.prj rename to hrds/tests/real_data/high_res_area.prj diff --git a/tests/real_data/high_res_area.qpj b/hrds/tests/real_data/high_res_area.qpj similarity index 100% rename from tests/real_data/high_res_area.qpj rename to hrds/tests/real_data/high_res_area.qpj diff --git a/tests/real_data/high_res_area.shp b/hrds/tests/real_data/high_res_area.shp similarity index 100% rename from tests/real_data/high_res_area.shp rename to hrds/tests/real_data/high_res_area.shp diff --git a/tests/real_data/high_res_area.shx b/hrds/tests/real_data/high_res_area.shx similarity index 100% rename from tests/real_data/high_res_area.shx rename to hrds/tests/real_data/high_res_area.shx diff --git a/tests/real_data/inspire_data.tif b/hrds/tests/real_data/inspire_data.tif similarity index 100% rename from tests/real_data/inspire_data.tif rename to hrds/tests/real_data/inspire_data.tif diff --git a/tests/real_data/real_data.qgs b/hrds/tests/real_data/real_data.qgs similarity index 100% rename from tests/real_data/real_data.qgs rename to hrds/tests/real_data/real_data.qgs diff --git a/tests/real_data/sample_points.cpg b/hrds/tests/real_data/sample_points.cpg similarity index 100% rename from tests/real_data/sample_points.cpg rename to hrds/tests/real_data/sample_points.cpg diff --git a/tests/real_data/sample_points.dbf b/hrds/tests/real_data/sample_points.dbf similarity index 100% rename from tests/real_data/sample_points.dbf rename to hrds/tests/real_data/sample_points.dbf diff --git a/tests/real_data/sample_points.prj b/hrds/tests/real_data/sample_points.prj similarity index 100% rename from tests/real_data/sample_points.prj rename to hrds/tests/real_data/sample_points.prj diff --git a/tests/real_data/sample_points.qpj b/hrds/tests/real_data/sample_points.qpj similarity index 100% rename from tests/real_data/sample_points.qpj rename to hrds/tests/real_data/sample_points.qpj diff --git a/tests/real_data/sample_points.shp b/hrds/tests/real_data/sample_points.shp similarity index 100% rename from tests/real_data/sample_points.shp rename to hrds/tests/real_data/sample_points.shp diff --git a/tests/real_data/sample_points.shx b/hrds/tests/real_data/sample_points.shx similarity index 100% rename from tests/real_data/sample_points.shx rename to hrds/tests/real_data/sample_points.shx diff --git a/tests/real_data/style.qml b/hrds/tests/real_data/style.qml similarity index 100% rename from tests/real_data/style.qml rename to hrds/tests/real_data/style.qml diff --git a/tests/real_data/test_mesh.csv b/hrds/tests/real_data/test_mesh.csv similarity index 100% rename from tests/real_data/test_mesh.csv rename to hrds/tests/real_data/test_mesh.csv diff --git a/tests/real_data/test_mesh.geo b/hrds/tests/real_data/test_mesh.geo similarity index 100% rename from tests/real_data/test_mesh.geo rename to hrds/tests/real_data/test_mesh.geo diff --git a/tests/real_data/test_mesh.msh b/hrds/tests/real_data/test_mesh.msh similarity index 100% rename from tests/real_data/test_mesh.msh rename to hrds/tests/real_data/test_mesh.msh diff --git a/tests/real_data/xyz_example.py b/hrds/tests/real_data/xyz_example.py similarity index 100% rename from tests/real_data/xyz_example.py rename to hrds/tests/real_data/xyz_example.py diff --git a/tests/test_buffer.py b/hrds/tests/test_buffer.py similarity index 100% rename from tests/test_buffer.py rename to hrds/tests/test_buffer.py diff --git a/tests/test_hrds.py b/hrds/tests/test_hrds.py similarity index 100% rename from tests/test_hrds.py rename to hrds/tests/test_hrds.py diff --git a/tests/test_interpolation.py b/hrds/tests/test_interpolation.py similarity index 100% rename from tests/test_interpolation.py rename to hrds/tests/test_interpolation.py diff --git a/tests/test_raster.asc b/hrds/tests/test_raster.asc similarity index 100% rename from tests/test_raster.asc rename to hrds/tests/test_raster.asc diff --git a/tests/test_raster_large.tif b/hrds/tests/test_raster_large.tif similarity index 100% rename from tests/test_raster_large.tif rename to hrds/tests/test_raster_large.tif diff --git a/tests/test_raster_nodata_centre.tif b/hrds/tests/test_raster_nodata_centre.tif similarity index 100% rename from tests/test_raster_nodata_centre.tif rename to hrds/tests/test_raster_nodata_centre.tif diff --git a/setup.py b/setup.py index 8b36841..c8904bd 100644 --- a/setup.py +++ b/setup.py @@ -1,20 +1,40 @@ import setuptools +DESCRIPTION = """ +hrds is a python package for obtaining points from a set of raster at +different resolutions. You can request a point (or list of points) and +hrds will return a value based on the highest resolution dataset (as +defined by the user) available at that point, blending datasets in a +buffer region to ensure consistancy. +""" + + +def get_version(): + """ + kludgy, but lets you set version in one place, and have it in the + package + """ + with open("hrds/__init__.py") as initfile: + for line in initfile: + parts = line.strip().split("=") + if parts[0].strip() == "__version__": + version = parts[1].strip().strip("'").strip('"') + return version + raise ValueError("no __version__ defined in package __init__") + + setuptools.setup(name='hrds', - version='0.1', - author='Jon Hill', - author_email='jon.hill@york.ac.uk', - description="hrds is a python package for obtaining points from a set of raster at different resolutions."+ - "You can request a point (or list of points) and hrds will return a value based on"+ - "the highest resolution dataset (as defined by the user) available at that point, blending"+ - "datasets in a buffer region to ensure consistancy.", - url='https://github.com/stephankramer/uptide', - packages = setuptools.find_packages(), - keywords = ['raster', 'gis', 'modelling'], - classifiers = [ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)', - 'Programming Language :: Python :: 2.7', - 'Topic :: Scientific/Engineering'], - ) + version=get_version(), + author='Jon Hill', + author_email='jon.hill@york.ac.uk', + description=DESCRIPTION, + url='https://github.com/stephankramer/uptide', + packages=setuptools.find_packages(), + keywords=['raster', 'gis', 'modelling'], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)', + 'Programming Language :: Python :: 2.7', + 'Topic :: Scientific/Engineering'], + )