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

Explicitly set nopython=False in numba.jit #535

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions libpysal/cg/alpha_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
__all__ = ["alpha_shape", "alpha_shape_auto"]


@jit
@jit(nopython=False)
def nb_dist(x, y):
"""numba implementation of distance between points `x` and `y`

Expand Down Expand Up @@ -164,7 +164,7 @@ def r_circumcircle_triangle(a_s, b_s, c_s):
return r2


@jit
@jit(nopython=False)
def get_faces(triangle):
"""Extract faces from a single triangle

Expand Down Expand Up @@ -198,7 +198,7 @@ def get_faces(triangle):
return faces


@jit
@jit(nopython=False)
def build_faces(faces, triangles_is, num_triangles, num_faces_single):
"""Build facing triangles

Expand Down Expand Up @@ -260,7 +260,7 @@ def build_faces(faces, triangles_is, num_triangles, num_faces_single):
return faces


@jit
@jit(nopython=False)
def nb_mask_faces(mask, faces):
"""Run over each row in `faces`, if the face in the following row is the
same, then mark both as False on `mask`
Expand Down
15 changes: 10 additions & 5 deletions libpysal/cg/voronoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,16 @@ def as_dataframes(regions, vertices, points):
from .shapes import Polygon, Point

if gpd is not None:
region_df = gpd.GeoDataFrame()
region_df["geometry"] = [Polygon(vertices[region]) for region in regions]

point_df = gpd.GeoDataFrame()
point_df["geometry"] = gpd.GeoSeries(Point(pnt) for pnt in points)
region_df = gpd.GeoDataFrame(
geometry = gpd.GeoSeries(
Polygon(vertices[region]) for region in regions
)
)
point_df = gpd.GeoDataFrame(
geometry = gpd.GeoSeries(
Point(pnt) for pnt in points
)
)
else:
import pandas as pd

Expand Down
Loading