Skip to content

Fix:add downhole plot#13

Merged
lachlangrose merged 6 commits intomasterfrom
fix/add-downhole-plot
Feb 26, 2026
Merged

Fix:add downhole plot#13
lachlangrose merged 6 commits intomasterfrom
fix/add-downhole-plot

Conversation

@lachlangrose
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
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

Adds downhole plotting utilities to the drillhole subsystem, enabling quick visualization of interval/point table variables per hole (line, categorical, and numeric “image” styles), plus an example script demonstrating usage.

Changes:

  • Added plot_downhole to DrillholeDatabase for multi-hole plotting with grid/column layouts and shared categorical legends.
  • Added downhole sampling helpers and plot_downhole to DrillHole for per-hole plotting.
  • Added examples/plot_downhole.py demonstrating line, categorical, and image plotting workflows.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
loopresources/drillhole/drillhole_database.py Adds multi-hole downhole plotting + shared categorical legend helper.
loopresources/drillhole/drillhole.py Adds per-hole downhole sampling utilities and plotting API.
examples/plot_downhole.py New example showcasing downhole plot variants and legend usage.

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

Comment on lines +366 to +370
if show_legend and legend_loc != "none":
handles = [
mpatches.Patch(color=cmap_obj(i), label=str(cat))
for i, cat in enumerate(categories)
]
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

legend_loc is documented as {"right", "bottom", "none"} but it isn’t normalized/validated, so values like "Right" or typos silently skip adding a legend. Consider legend_loc = legend_loc.lower() and raising a ValueError when it’s not one of the supported values.

Copilot uses AI. Check for mistakes.
Comment thread loopresources/drillhole/drillhole_database.py Outdated
Comment thread loopresources/drillhole/drillhole_database.py Outdated
Comment on lines +145 to +149
def plot_downhole(
self,
table_name: str,
column: str,
holes: Optional[List[str]] = None,
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

New plotting behavior is introduced here, but there are no tests covering the expected outputs (e.g., categorical vs numeric sampling, missing column/table errors, and multi-hole layout handling). Since this repo already has substantial tests/test_drillhole_database*.py coverage, adding a few targeted unit tests that validate the sampled depth/value arrays (without asserting on rendered Matplotlib output) would help prevent regressions.

Copilot uses AI. Check for mistakes.
Comment on lines +401 to +405
def _sample_downhole_values(
self,
table_name: str,
column: str,
step: float,
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

These new sampling helpers are core logic that the plotting APIs depend on, but there are no unit tests exercising their outputs for interval vs point tables (and categorical vs numeric data). Consider adding tests that assert the generated depth grid and sampled values (plus error cases like unknown tables / missing columns) to avoid relying on Matplotlib rendering in tests.

Copilot uses AI. Check for mistakes.
lachlangrose and others added 4 commits February 26, 2026 14:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lachlangrose lachlangrose merged commit a0e6e7d into master Feb 26, 2026
@lachlangrose lachlangrose deleted the fix/add-downhole-plot branch February 26, 2026 03:58
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