Skip to content

Commit

Permalink
Address numpy 2.0 warning and fix codecov v4 setup (#227)
Browse files Browse the repository at this point in the history
* Address numpy 2.0 warning: numpy/numpy#26620
* Address issue with codecov uploading: codecov/codecov-action#1274
  • Loading branch information
stefmolin authored Oct 5, 2024
1 parent 5726e35 commit e4424fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ jobs:
run: pytest

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6 changes: 4 additions & 2 deletions src/data_morph/shapes/bases/line_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ def distance(self, x: Number, y: Number) -> float:
)

# row-wise cross products of 2D vectors
perpendicular_distance_component = np.cross(
point - start_points, normalized_tangent_vectors
diff = point - start_points
perpendicular_distance_component = (
diff[..., 0] * normalized_tangent_vectors[..., 1]
- diff[..., 1] * normalized_tangent_vectors[..., 0]
)

return np.min(
Expand Down

0 comments on commit e4424fd

Please sign in to comment.