GEOPY-2781: Inversion stalls on tiling for large problems during redistribution of clusters#365
Open
domfournier wants to merge 10 commits intodevelopfrom
Open
GEOPY-2781: Inversion stalls on tiling for large problems during redistribution of clusters#365domfournier wants to merge 10 commits intodevelopfrom
domfournier wants to merge 10 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the location-tiling behavior used to partition survey locations into tiles, apparently to remove the previous “even population” rebalancing step (which relied on linear_sum_assignment) and to adjust tests accordingly.
Changes:
- Simplifies
tile_locations()to always use raw KMeans cluster labels (removing the redistribution/balancing step). - Disables the tile-population balancing test by commenting it out and adding TODO notes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/locations_test.py |
Comments out the population-balancing test for tile_locations() and adds TODO notes about a future scalable balancing approach. |
simpeg_drivers/utils/nested.py |
Removes the Hungarian-assignment-based rebalancing logic; tile_locations() now returns KMeans labels directly. |
Comments suppressed due to low confidence (1)
simpeg_drivers/utils/nested.py:545
- When
sortingis provided,grid_locsis permuted before fitting KMeans, but the returned tile indices are positions in that permuted array. Downstream slicing (e.g.,create_survey()filterssurvey.ordering[:, 2]against the provided indices) expects receiver IDs in the original indexing used byordering(often the geoh5/receiver index, not the permuted position). Please map the clustered indices back throughsortingbefore returning (or avoid permutinggrid_locsand instead pass weights/ordering differently), so tiles reference the same index space assurvey.ordering.
cluster_id = kmeans.labels_
tiles = []
for tid in set(cluster_id):
tiles += [np.where(cluster_id == tid)[0]]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #365 +/- ##
===========================================
- Coverage 89.85% 89.83% -0.02%
===========================================
Files 125 125
Lines 6437 6425 -12
Branches 794 793 -1
===========================================
- Hits 5784 5772 -12
Misses 449 449
Partials 204 204
🚀 New features to boost your workflow:
|
benk-mira
requested changes
Mar 25, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GEOPY-2781 - Inversion stalls on tiling for large problems during redistribution of clusters