Skip to content

Standardize error handling for None in Point.nearest_points() and Point.shortest_line()#45

Merged
mindflayer merged 4 commits intoshapely-nearest-points-shortest-linefrom
copilot/sub-pr-42-another-one
Jan 17, 2026
Merged

Standardize error handling for None in Point.nearest_points() and Point.shortest_line()#45
mindflayer merged 4 commits intoshapely-nearest-points-shortest-linefrom
copilot/sub-pr-42-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 17, 2026

  • Add explicit None checks to Point class's nearest_points() method
  • Add explicit None checks to Point class's shortest_line() method
  • Ensure error messages are consistent across all geometry classes
  • Remove redundant else clauses (feedback from review)
  • All tests pass

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…nt.shortest_line()

Co-authored-by: mindflayer <527325+mindflayer@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on adding Shapely's nearest_points and shortest_line Standardize error handling for None in Point.nearest_points() and Point.shortest_line() Jan 17, 2026
Copilot AI requested a review from mindflayer January 17, 2026 15:50
@mindflayer
Copy link
Copy Markdown
Owner

@copilot the else you added are redundant, not necessary.

Comment thread togo.pyx Outdated
Comment thread togo.pyx Outdated
@mindflayer
Copy link
Copy Markdown
Owner

@copilot are we testing the new checks?

@mindflayer mindflayer marked this pull request as ready for review January 17, 2026 16:05
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 17, 2026

@copilot the else you added are redundant, not necessary.

You're right - the else clauses were redundant. They've been removed in commits ddb530c and 2d135c9. The code now follows the cleaner pattern without the unnecessary else: blocks.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 17, 2026

@copilot are we testing the new checks?

Yes, the new None checks are tested:

  • test_nearest_points_invalid_other (line 93) tests point.nearest_points(None)
  • test_shortest_line_invalid_other (line 158) tests point.shortest_line(None)

Both tests verify that ValueError is raised with the new explicit None checks.

@mindflayer mindflayer merged commit ae62184 into shapely-nearest-points-shortest-line Jan 17, 2026
1 check passed
@mindflayer mindflayer deleted the copilot/sub-pr-42-another-one branch January 17, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants