Skip to content

fix(vtk): fix add_pathline_points prt data handling#2732

Merged
wpbonelli merged 1 commit intomodflowpy:developfrom
wpbonelli:fix-vtk-pathlines
Mar 18, 2026
Merged

fix(vtk): fix add_pathline_points prt data handling#2732
wpbonelli merged 1 commit intomodflowpy:developfrom
wpbonelli:fix-vtk-pathlines

Conversation

@wpbonelli
Copy link
Member

@wpbonelli wpbonelli commented Mar 18, 2026

The logic to separate PRT pathlines by composite key for VTK export was

  • slow: O(n^4 * m) where n is unique values per column and m is the total number of rows
  • wrong: exported empty pathlines in most cases due to some incorrect filtering

Replace the nested loops and repeated np.unique() calls with a single unique(return_inverse=True) taking a composite key dtype. Should be O(n log n) now.

@wpbonelli wpbonelli added this to the 3.10.1 milestone Mar 18, 2026
@wpbonelli wpbonelli added the bug label Mar 18, 2026
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.4%. Comparing base (556c088) to head (8e87839).
⚠️ Report is 142 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2732      +/-   ##
===========================================
+ Coverage     55.5%    72.4%   +16.9%     
===========================================
  Files          644      674      +30     
  Lines       124135   130618    +6483     
===========================================
+ Hits         68947    94649   +25702     
+ Misses       55188    35969   -19219     
Files with missing lines Coverage Δ
flopy/export/vtk.py 69.8% <100.0%> (-8.3%) ⬇️

... and 569 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wpbonelli wpbonelli marked this pull request as ready for review March 18, 2026 14:36
@wpbonelli wpbonelli merged commit 20ce356 into modflowpy:develop Mar 18, 2026
19 checks passed
@wpbonelli wpbonelli deleted the fix-vtk-pathlines branch March 18, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant