Skip to content

Conversation

@lachlangrose
Copy link
Member

No description provided.

Copy link
Contributor

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

Adjusts InterpolatedStructure thickness debug outputs to use the first geometry returned by shapely.shortest_line(...) consistently, and to record all dip estimates (rather than a single aggregated entry) alongside their corresponding shortest-line geometries.

Changes:

  • Use short_line[0] consistently for length filtering and proximity queries (dwithin/distance fallback).
  • Record one line per dip sample by extending _lines/_dips instead of appending a single entry.
  • Minor whitespace-only change near the self.lines GeoDataFrame creation.

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

Comment on lines 406 to 410
# find the indices of the points that are within 5% of the length of the shortest line
try:
# GEOS 3.10.0+
indices = shapely.dwithin(short_line, interp_points, line_length * 0.25)
indices = shapely.dwithin(short_line[0], interp_points, line_length * 0.25)
except UnsupportedGEOSVersionError:
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The comment says points are selected within 5% of the shortest-line length, but the threshold used is line_length * 0.25 (25%). Please update the comment or adjust the factor so they match.

Copilot uses AI. Check for mistakes.
indices = shapely.dwithin(short_line, interp_points, line_length * 0.25)
indices = shapely.dwithin(short_line[0], interp_points, line_length * 0.25)
except UnsupportedGEOSVersionError:
indices= numpy.array([shapely.distance(short_line[0],point)<= (line_length * 0.25) for point in interp_points])
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

This fallback branch is not formatted according to the repo’s Black configuration (e.g., missing spaces around = and after commas). Please reformat this line to match the rest of the codebase.

Suggested change
indices= numpy.array([shapely.distance(short_line[0],point)<= (line_length * 0.25) for point in interp_points])
indices = numpy.array([shapely.distance(short_line[0], point) <= (line_length * 0.25) for point in interp_points])

Copilot uses AI. Check for mistakes.
else:
self.location_tracking = geopandas.GeoDataFrame(columns=['p1_x', 'p1_y', 'p1_z', 'p2_x', 'p2_y', 'p2_z', 'thickness', 'unit', 'geometry'], crs=basal_contacts.crs)
# Create GeoDataFrame for lines

Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

There appears to be trailing whitespace on this blank line. Please remove the extra spaces (or delete the blank line) to avoid lint/format churn.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines +414 to +416
if len(_dip) > 0:
_lines.extend([short_line[0]]*len(_dip))
_dips.extend(_dip)
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

This change alters the shape/semantics of the debug output (self.lines) by emitting one row per dip sample (_lines.extend(...); _dips.extend(...)). There are existing tests for InterpolatedStructure.compute, but none assert the contents/lengths of thickness_calculator.lines; please add a regression test to cover the new behavior (e.g., that len(lines) == len(lines['dip']) and multiple dip samples produce multiple line rows).

Copilot uses AI. Check for mistakes.
@lachlangrose
Copy link
Member Author

@rabii-chaarani can you approve this before the workshop? we'll need to release a new version. Thanks!

@rabii-chaarani rabii-chaarani merged commit 381d13f into master Jan 31, 2026
8 of 10 checks passed
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