Skip to content

GEOPY-2608: Ignore segments of zero length to prevent warning from numpy#115

Merged
domfournier merged 1 commit into
release/GA_4.8from
GEOPY-2608
Apr 28, 2026
Merged

GEOPY-2608: Ignore segments of zero length to prevent warning from numpy#115
domfournier merged 1 commit into
release/GA_4.8from
GEOPY-2608

Conversation

@benk-mira
Copy link
Copy Markdown
Contributor

@benk-mira benk-mira commented Apr 28, 2026

GEOPY-2608 - Ignore segments of zero length to prevent warning from numpy

Copilot AI review requested due to automatic review settings April 28, 2026 15:33
@github-actions github-actions Bot changed the title GEOPY-2608 GEOPY-2608: Ignore segments of zero length to prevent warning from numpy Apr 28, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds explicit handling and test coverage for zero-length segments when computing segment orientations, preventing divide-by-zero warnings and clarifying expected behavior in downstream drivers that consume segment azimuth.

Changes:

  • Update orientation_from_segments to return NaN orientations for zero-length segments instead of dividing by zero.
  • Add a unit test validating lengths/orientations across typical, mirrored, and zero-length segment cases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
curve_apps/utils.py Avoids division by zero in orientation_from_segments by masking zero-length segments and returning NaN orientations for them.
tests/utils_test.py Adds coverage for orientation_from_segments, including a zero-length segment case asserting NaN orientation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@domfournier domfournier merged commit 059dda6 into release/GA_4.8 Apr 28, 2026
21 checks passed
@domfournier domfournier deleted the GEOPY-2608 branch April 28, 2026 22:29
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.

3 participants