joe-jordan/pyvoro — pull request #10 by wackywendell (2014-11-04 23:39:52+00:00)
Title: Cython update, Unittests, and Python 3 support

I've now updated the code to support Python 3, and added the unittests to go with it. Naturally, this also required a Cython update. I also updated the distutils classifiers, partly to indicate this dual support.

Testing on Python 2.7 and Python 3.4:

```
$ nosetests2 --with-coverage pyvoro
..........
Name Stmts Miss Cover Missing
--------------------------------------
pyvoro 83 0 100%
----------------------------------------------------------------------
Ran 10 tests in 0.007s

OK
$ nosetests --with-coverage pyvoro
..........
Name Stmts Miss Cover Missing
--------------------------------------
pyvoro 83 0 100%
----------------------------------------------------------------------
Ran 10 tests in 0.006s

OK
```

The `unittest` module is included all the way back to Python 2.1, and `from __future__ import division` is as old as Python 2.2, so although I only tested Python 3.4 and Python 2.7, this will probably work with Python versions as old as that.

The "100% coverage" above just means that I used both `compute_voronoi` and `compute_2d_voronoi` functions in the unit test, but a careful look at the tests will show that I tested all five aspects of the cells: volume, original position, vertices, faces, and adjacency. This was only done on a system with 2 particles, but if it works for those, I expect it should work in general... at least as much as the Python code is involved. The unit tests may not provide *complete* coverage of the C++ code, but that is unaffected by this pull request.