We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
point_in_polygon()
1 parent 3398ffb commit 3f0784aCopy full SHA for 3f0784a
named_arrays/geometry/_point_in_polygon.py
@@ -117,9 +117,11 @@ def _point_in_polygon_quantity(
117
118
if isinstance(x, u.Quantity):
119
unit = x.unit
120
- y = y.to_value(unit)
121
- vertices_x = vertices_x.to_value(unit)
122
- vertices_y = vertices_y.to_value(unit)
+ if unit != 1:
+ x = x.value
+ y = y.to_value(unit)
123
+ vertices_x = vertices_x.to_value(unit)
124
+ vertices_y = vertices_y.to_value(unit)
125
126
shape_points = np.broadcast(x, y).shape
127
shape_vertices = np.broadcast(vertices_x, vertices_y).shape
0 commit comments