Skip to content

fix(zonebudget_example): index the budget values by position - #2801

Merged
jdhughes-dev merged 1 commit into
modflowpy:developfrom
jdhughes-dev:fix-zonebudget-notebook
Aug 7, 2026
Merged

fix(zonebudget_example): index the budget values by position#2801
jdhughes-dev merged 1 commit into
modflowpy:developfrom
jdhughes-dev:fix-zonebudget-notebook

Conversation

@jdhughes-dev

Copy link
Copy Markdown
Contributor

volumetric_budget_bar_plot labels each bar by indexing the values with the position of the bar, but the values are passed in as a series indexed by zone name, so the label lookup raised KeyError: 0. Pandas used to fall back to positional indexing for a series that is not indexed by integers and no longer does. The values are now taken out of the series before they are indexed.

This is one of the notebooks failing in the nightly example workflow. The notebook runs to completion with this change and raises the KeyError without it.

volumetric_budget_bar_plot labels each bar by indexing the values with the
position of the bar, but the values are passed in as a series indexed by
zone name, so the label lookup raised a KeyError. Pandas used to fall back
to positional indexing for a series that is not indexed by integers and no
longer does. The values are now taken out of the series before they are
indexed.
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2801      +/-   ##
===========================================
+ Coverage     55.5%    72.8%   +17.2%     
===========================================
  Files          644      662      +18     
  Lines       124135   133024    +8889     
===========================================
+ Hits         68947    96851   +27904     
+ Misses       55188    36173   -19015     

see 583 files with indirect coverage changes

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

@jdhughes-dev
jdhughes-dev merged commit 79a031a into modflowpy:develop Aug 7, 2026
20 checks passed
@jdhughes-dev
jdhughes-dev deleted the fix-zonebudget-notebook branch August 7, 2026 18:27
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.

1 participant