Skip to content

GEOPY-2594#135

Merged
domfournier merged 3 commits intodevelopfrom
GEOPY-2594
Mar 26, 2026
Merged

GEOPY-2594#135
domfournier merged 3 commits intodevelopfrom
GEOPY-2594

Conversation

@domfournier
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings March 25, 2026 15:07
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

This PR updates PGI (Petrophysically/Geologically Guided Inversion) utilities to suppress warnings emitted during KMeans-based initialization of Gaussian mixture parameters.

Changes:

  • Wrap KMeans initialization in a warnings.catch_warnings() context.
  • Add a blanket warnings.simplefilter("ignore") to silence warnings during .fit(...).labels_ extraction.

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

Comment on lines +334 to +340
with warnings.catch_warnings():
warnings.simplefilter("ignore")
label = (
KMeans(
n_clusters=self.n_components, n_init=1, random_state=random_state
)
.fit(X, sample_weight=self.cell_volumes)
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The warnings suppression here is overly broad: warnings.simplefilter("ignore") will silence all warnings emitted during the KMeans fit (including FutureWarning/DeprecationWarning that could indicate real issues). Consider narrowing this to the specific warning(s) you intend to suppress (e.g., category=ConvergenceWarning and/or a message= match) so unexpected warnings still surface.

Copilot uses AI. Check for mistakes.
@domfournier domfournier merged commit f7dd0d3 into develop Mar 26, 2026
9 checks passed
@domfournier domfournier deleted the GEOPY-2594 branch March 26, 2026 14:35
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