Skip to content

fix(mfdatascalar): skip multiple choice fields with default values#2712

Open
wpbonelli wants to merge 3 commits intomodflowpy:developfrom
wpbonelli:fix-2710
Open

fix(mfdatascalar): skip multiple choice fields with default values#2712
wpbonelli wants to merge 3 commits intomodflowpy:developfrom
wpbonelli:fix-2710

Conversation

@wpbonelli
Copy link
Member

@wpbonelli wpbonelli commented Feb 15, 2026

When writing MF6 input files, don't write optional scalar variables whose values are equal to the defaults as specified in DFNs. This is a backwards-compatibility fix meant to keep new/breaking options from being written to input files when they are not explicitly used, so that new versions of flopy remain compatible with older versions of MF6.

This could cause significant differences in input files, but should not cause behavioral differences as MF6 implements the default values internally.

Introduce an option write_defaults on the simulation, to allow opting into the old behavior. I figure it can still be useful as a kind of 'strict' mode.

Fix #2710

@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2712      +/-   ##
===========================================
+ Coverage     55.5%    72.4%   +16.9%     
===========================================
  Files          644      674      +30     
  Lines       124135   130572    +6437     
===========================================
+ Hits         68947    94635   +25688     
+ Misses       55188    35937   -19251     
Files with missing lines Coverage Δ
flopy/mf6/data/mfdatascalar.py 60.4% <100.0%> (+1.0%) ⬆️
flopy/mf6/data/mfstructure.py 74.2% <100.0%> (+0.4%) ⬆️
flopy/mf6/mfsimbase.py 62.7% <100.0%> (-12.8%) ⬇️

... and 567 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 February 16, 2026 13:17
@wpbonelli wpbonelli added this to the 3.10.1 milestone Feb 16, 2026
@wpbonelli wpbonelli changed the title fix(mfdatascalar): skip fields with default values fix(mfdatascalar): skip multiple choice fields with default values Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: the default value for coordinate_check_method in ModflowPrtprp of 'eager' errors in latest MODFLOW (6.6.3)

1 participant