Skip to content

chip away some refactors in geometry.py#46

Merged
jGaboardi merged 3 commits intomainfrom
GL20_geometry_tests
Oct 17, 2024
Merged

chip away some refactors in geometry.py#46
jGaboardi merged 3 commits intomainfrom
GL20_geometry_tests

Conversation

@jGaboardi
Copy link
Collaborator

This PR:

  • chips way some refactoring in geometry.py
  • DRYs out geometry.snap_to_targets() & breaks out some helper funds
  • add dedicated granular test for helpers
  • xref testing, refactor, & docstrings #20

@codecov
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.1%. Comparing base (32d1f0c) to head (2777b44).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main     #46   +/-   ##
=====================================
  Coverage   98.1%   98.1%           
=====================================
  Files          6       6           
  Lines        880     891   +11     
=====================================
+ Hits         863     874   +11     
  Misses        17      17           
Files with missing lines Coverage Δ
sgeop/geometry.py 100.0% <100.0%> (ø)

# if there is no explicit snapping target, snap to the boundary of the polygon
# via the shortest line. That is by definition always within the polygon
# (Martin thinks)
# (Martin thinks) (James concurs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Comment on lines 404 to 406
def _last_point(line: shapely.LineString) -> shapely.Point:
"""Helper for returning final point on a line."""
return shapely.get_point(line, -1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably prefer using shapely.get_point(line, -1) and it is explicit

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got no problem with that. I'll dump that helper and remove from testing.

@jGaboardi jGaboardi merged commit 89f6f8b into main Oct 17, 2024
@jGaboardi jGaboardi deleted the GL20_geometry_tests branch October 17, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants