generalized to arbitrary dimension
add extra checks, improve error message
Merge pull request #3 from thouis/arbitrary_dimension

Arbitrary dimensions in python wrapper