Skip to content

Conversation

@mwtoews
Copy link
Contributor

@mwtoews mwtoews commented Sep 8, 2025

This makes base mf6 classes and in the jinja codegen template docstrings more consistent, among other changes detailed here:

  • Move primary class initialization documentation from "init" to "class" (since the default for Sphinx's autoclass_content is 'class', thus class docs are rendered preferentially over init docs). Keep a short docstring for init, which does not get rendered by Spinx, but satisfies (e.g.) D107.
  • Consistent case and punctuation for parameter descriptions; add defaults or tag as optional.
  • Mirror parameter descriptions in base .py class and in .jinga templates, checking they also match function signatures.
  • Adjust function calls to use more keyword parameters than positional to guard against API changes.
  • Move static functions out of Filters (in flopy.mf6.utils.codegen.filters), since it wasn't used as an OOP class; only minor changes to the filter functions were required (e.g. renaming variables to distinguish them from functions with the same name).
  • Mark TODO for a Dfn bug with "items" in the "children" filter (issue not raised yet, but will be described soon)
  • Adjust generate_classes command to allow --no-verbose to turn off verbose (default remains with --verbose on).

@mwtoews mwtoews changed the title refactor(docs): mf6 package, model and sim docstrings; jinja filters refactor(docs): mf6 classes and codegen templates Sep 8, 2025
@codecov
Copy link

codecov bot commented Sep 8, 2025

Codecov Report

❌ Patch coverage is 0% with 301 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.5%. Comparing base (556c088) to head (dab7c4a).
⚠️ Report is 41 commits behind head on develop.

Files with missing lines Patch % Lines
flopy/mf6/utils/codegen/filters.py 0.0% 276 Missing ⚠️
flopy/mf6/utils/codegen/__init__.py 0.0% 24 Missing ⚠️
flopy/mf6/utils/generate_classes.py 0.0% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2593      +/-   ##
===========================================
+ Coverage     55.5%    72.5%   +16.9%     
===========================================
  Files          644      667      +23     
  Lines       124135   128669    +4534     
===========================================
+ Hits         68947    93307   +24360     
+ Misses       55188    35362   -19826     
Files with missing lines Coverage Δ
flopy/mf6/mfmodel.py 57.0% <ø> (-23.9%) ⬇️
flopy/mf6/mfpackage.py 68.4% <ø> (-13.2%) ⬇️
flopy/mf6/mfsimbase.py 62.2% <ø> (-13.2%) ⬇️
flopy/mf6/utils/generate_classes.py 17.5% <0.0%> (ø)
flopy/mf6/utils/codegen/__init__.py 0.0% <0.0%> (ø)
flopy/mf6/utils/codegen/filters.py 0.0% <0.0%> (ø)

... and 545 files with indirect coverage changes

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

Copy link
Member

@wpbonelli wpbonelli left a comment

Choose a reason for hiding this comment

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

thanks for this!

CI failure is unrelated, it's a particle tracking thing. should be fixed soon enough.

Mark TODO for a Dfn bug with "items" in the "children" filter (issue not raised yet, but will be described soon)

yeah, this code generation stuff is now consuming a new TOML format for DFNs which is still not really hammered out yet. but its coming from devtools. we froze the version recently to avoid churn. you may want to raise the issue on devtools, unless it's also relevant here?

@mwtoews
Copy link
Contributor Author

mwtoews commented Sep 9, 2025

I'm only partway narrowing down the issue, but the issue is connected to recent dfn additions to modflow6 that trace to devtools that break code generation from flopy. So it's a bit all over the place.

@wpbonelli
Copy link
Member

recent dfn additions to modflow6 that trace to devtools

I just meant to warn you that any DFN oddities you see here may not be changes to dfns in modflow6, rather more likely related to our monkeying around in devtools.

So it's a bit all over the place.

Yes. Things to be kept in sync across several repos. Painful, but temporary

@wpbonelli wpbonelli merged commit 3dc8957 into modflowpy:develop Sep 9, 2025
19 of 20 checks passed
@mwtoews mwtoews deleted the refactor-jinja-docstrings branch September 9, 2025 17:57
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