Skip to content

Fix misleading comment on water_cells in dig_rivers.py#83

Merged
spiani merged 2 commits into
no_ob_indices_anymorefrom
copilot/sub-pr-82
Mar 12, 2026
Merged

Fix misleading comment on water_cells in dig_rivers.py#83
spiani merged 2 commits into
no_ob_indices_anymorefrom
copilot/sub-pr-82

Conversation

Copilot AI commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

The comment preceding the water_cells computation referred to checking "open sides" — logic that was already removed — leaving a stale, inaccurate description that would confuse future maintainers.

Changes

  • src/bathytools/actions/dig_rivers.py: Replaced the outdated # Check if a side is "open" comment with an accurate description of what water_cells is and where it's actually used:
# Precompute a boolean array of cells that are already underwater
# (negative bathymetry). Used later to skip water cells when tracking
# river dig cells for intersection detection.
b_array = bathymetry.elevation.transpose("latitude", "longitude").values
water_cells = b_array < 0

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: spiani <8956990+spiani@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback on removing ob indices from the implementation Fix misleading comment on water_cells in dig_rivers.py Mar 12, 2026
@spiani spiani marked this pull request as ready for review March 12, 2026 14:22
Copilot AI review requested due to automatic review settings March 12, 2026 14:22
@spiani spiani merged commit f6f91d9 into no_ob_indices_anymore Mar 12, 2026
1 check passed
@spiani spiani deleted the copilot/sub-pr-82 branch March 12, 2026 14:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates an outdated inline comment in dig_rivers.py so it accurately describes the water_cells precomputation and its later role in skipping already-underwater cells during river intersection tracking.

Changes:

  • Replaced a stale “open side” comment with an accurate description of water_cells (underwater/negative bathymetry).
  • Clarified why the boolean mask is computed (used later when recording dig cells for intersection detection).

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

You can also share your feedback on Copilot code review. Take the survey.

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