Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pyarrow required dependency #64

Merged
merged 30 commits into from
Nov 15, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
kylebarron committed Nov 8, 2024
commit 853c317cb4eecfbf478437c0c279c8a1c5a4e64f
46 changes: 0 additions & 46 deletions h3ronpy/tests/pandas/test_resolution.py

This file was deleted.

54 changes: 6 additions & 48 deletions h3ronpy/tests/pandas/test_vector.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,13 @@
import shapely

import geopandas as gpd
import pandas as pd
from shapely.geometry import Point, GeometryCollection, Polygon
import pytest
from h3ronpy.pandas import change_resolution
from h3ronpy.pandas.vector import (
cells_to_points,
cells_to_polygons,
cells_dataframe_to_geodataframe,
geodataframe_to_cells,
geoseries_to_cells,
)
import shapely
from h3ronpy import DEFAULT_CELL_COLUMN_NAME, ContainmentMode
import geopandas as gpd
from .. import load_africa, TESTDATA_PATH
from h3ronpy.arrow import change_resolution
from h3ronpy.pandas.vector import cells_dataframe_to_geodataframe, geodataframe_to_cells
from shapely.geometry import GeometryCollection, Point, Polygon


def test_cells_to_points():
gs = cells_to_points(
[
0x8009FFFFFFFFFFF,
]
)
assert isinstance(gs, gpd.GeoSeries)
assert gs.geom_type[0] == "Point"


def test_cells_to_polygons():
cells = change_resolution(
[
0x8009FFFFFFFFFFF,
],
3,
)
gs = cells_to_polygons(cells)
assert isinstance(gs, gpd.GeoSeries)
assert gs.geom_type[0] == "Polygon"
assert len(gs) == 286

linked_gs = cells_to_polygons(cells, link_cells=True)
assert isinstance(linked_gs, gpd.GeoSeries)
assert linked_gs.geom_type[0] == "Polygon"
assert len(linked_gs) == 1
assert shapely.get_num_coordinates(linked_gs[0]) > 120
from .. import TESTDATA_PATH, load_africa


def test_cells_dataframe_to_geodataframe():
@@ -78,13 +43,6 @@ def test_cells_geodataframe_to_cells():
assert df.dtypes[DEFAULT_CELL_COLUMN_NAME] == "uint64"


def test_geoseries_to_cells_flatten():
africa = load_africa()
cells = geoseries_to_cells(africa.geometry, 4, flatten=True)
assert len(cells) >= len(africa)
assert cells.dtype == "uint64"


@pytest.mark.skip(
reason="GeometryCollections are unsupported until https://github.com/geoarrow/geoarrow-rs/blob/3a2aaa883126274037cabaf46b1f5f6459938297/src/io/wkb/reader/geometry_collection.rs#L23 is fixed"
)
86 changes: 0 additions & 86 deletions h3ronpy/tests/polars/test_raster.py

This file was deleted.