Skip to content

Commit

Permalink
Add scipy to 'all' extra, fix deprecation of np.cross for 2D vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
aganders3 committed Jun 10, 2024
1 parent 593a870 commit 71b1384
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion phidl/device_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ def _line_distances(points, start, end):
return np.linalg.norm(points - start, axis=1)

vec = end - start
cross = np.cross(vec, start - points)
vec2 = start - points
cross = vec[..., 0] * vec2[..., 1] - vec[..., 1] * vec2[..., 0]
return np.divide(abs(cross), np.linalg.norm(vec))


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]

extras_require = {}
extras_require["all"] = ["freetype-py", "klayout", "rectpack"]
extras_require["all"] = ["freetype-py", "klayout", "rectpack", "scipy"]
extras_require["test"] = extras_require["all"] + ["pytest"]

# read the contents of your README file
Expand Down

0 comments on commit 71b1384

Please sign in to comment.