Skip to content

Commit

Permalink
unittest to reproduce #25
Browse files Browse the repository at this point in the history
  • Loading branch information
nmandery committed Jul 28, 2023
1 parent 0013e73 commit 869cd45
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Versioning <https://semver.org/spec/v2.0.0.html>`__.
Unreleased
----------

0.17.4 - 2023-07-28
-------------------

- Rebuild with h3o 0.3.4 to fix `#25 <https://github.com/nmandery/h3ronpy/issues/25>`_.

0.17.3 - 2023-07-27
-------------------

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "h3ronpy"
version = "0.17.3"
version = "0.17.4"
authors = ["Nico Mandery <nico@nmandery.net>"]
description = "Data science toolkit for the H3 geospatial grid"
edition = "2021"
Expand Down
13 changes: 12 additions & 1 deletion tests/arrow/test_vector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from h3ronpy.arrow.vector import geometry_to_cells
from h3ronpy.arrow.vector import geometry_to_cells, cells_to_coordinates
import pyarrow as pa
import shapely
from shapely.geometry import Point
import h3.api.numpy_int as h3


def test_geometry_to_cells():
Expand All @@ -9,3 +11,12 @@ def test_geometry_to_cells():
assert isinstance(cells, pa.Array)
assert cells.type == pa.uint64()
assert len(cells) > 10


def test_geometry_to_cells_central_park():
# Manhattan Central Park
point = Point(-73.9575, 40.7938)

arr = geometry_to_cells(point, 8).to_numpy()
assert len(arr) == 1
assert arr[0] == h3.geo_to_h3(point.y, point.x, 8)

0 comments on commit 869cd45

Please sign in to comment.