Skip to content

Commit

Permalink
Fix Dependencies and Documentation format.
Browse files Browse the repository at this point in the history
- Dependencies are now platform specific. A reasonably current version
  of pip will install pykdtree on linux systems and scipy on windows.
  Fix #26.
- Readme is now a rst file. This makes it compatible with pypi.
- use cKDTree from scipy. Faster than KDTree. Fix #22.
  • Loading branch information
Christoph Paulik committed Feb 4, 2016
1 parent d1ca34d commit 858cad8
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 40 deletions.
35 changes: 0 additions & 35 deletions README.md

This file was deleted.

57 changes: 57 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
pygeogrids
==========

This is a package for creation and handling of Discrete Global Grids or Point
collections. We hope extend the interface also to projected grids(images) in the
future.

For now the main features are:

- Creation of grids
- Nearest neighbor search
- conversion of grid piont indices to lat, lon
- Storage of grids and loading grids from CF-compatible netCDF files
- Calculation of lookup tables between grids
- Support for different Geodetic Datums using pyproj.

Installation
------------

To install the package use pip 6.0 or later. On linux systems `pykdtree
<https://github.com/storpipfugl/pykdtree>`__ will be installed whereas on
windows systems `scipy <http://www.scipy.org/>`__ ``cKDTree`` will be used.
pykdtree is faster than the scipy implementation but it is at the moment
not available for Windows systems.


Documentation
=============

|Documentation Status|

Build Status
============

|Build Status|

Test Coverage
=============

|Coverage Status|

Citing, DOI
===========

If you want to cite pygeogrids then please use the DOI of the version
you used.

|DOI|

.. |Documentation Status| image:: https://readthedocs.org/projects/pygeogrids/badge/?version=latest
:target: http://pygeogrids.readthedocs.org/
.. |Build Status| image:: https://travis-ci.org/TUW-GEO/pygeogrids.svg?branch=master
:target: https://travis-ci.org/TUW-GEO/pygeogrids
.. |Coverage Status| image:: https://coveralls.io/repos/TUW-GEO/pygeogrids/badge.svg?branch=master
:target: https://coveralls.io/r/TUW-GEO/pygeogrids?branch=master
.. |DOI| image:: https://zenodo.org/badge/12761/TUW-GEO/pygeogrids.svg
:target: http://dx.doi.org/10.5281/zenodo.17406
7 changes: 4 additions & 3 deletions pygeogrids/nearest_neighbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ def _transform_lonlats(self, lon, lat):
lon = np.array(lon)
lat = np.array(lat)
coords = np.zeros((lon.size, 3), dtype=np.float64)
coords[:, 0], coords[:, 1], \
coords[:, 2] = self.geodatum.toECEF(lon, lat)
(coords[:, 0],
coords[:, 1],
coords[:, 2]) = self.geodatum.toECEF(lon, lat)

return coords

Expand All @@ -154,7 +155,7 @@ def _build_kdtree(self):
if self.kd_tree_name == 'pykdtree' and pykdtree_installed:
self.kdtree = pykd.KDTree(self.coords)
elif scipy_installed:
self.kdtree = sc_spat.KDTree(self.coords)
self.kdtree = sc_spat.cKDTree(self.coords)
else:
raise Exception("No supported kdtree implementation installed.\
Please install pykdtree or scipy.")
Expand Down
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
numpy
netcdf4
pyproj
pykdtree
pykdtree ; sys_platform == 'linux'
pykdtree ; sys_platform == 'linux2'
scipy ; sys_platform == 'win32'
scipy ; sys_platform == 'win64'

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def setup_package():
author=metadata['author'],
author_email=metadata['author_email'],
license=metadata['license'],
long_description=read('README.md'),
long_description=read('README.rst'),
classifiers=metadata['classifiers'],
test_suite='tests',
packages=setuptools.find_packages(exclude=['tests', 'tests.*']),
Expand Down

0 comments on commit 858cad8

Please sign in to comment.