Skip to content

fix: apply docstring substitution decorators to public APIs - #3085

Merged
jgostick merged 1 commit into
PMEAL:devfrom
lyn1dev:fix/unresolved-docstring-tokens
Nov 26, 2026
Merged

jgostick merged 1 commit into
PMEAL:devfrom
lyn1dev:fix/unresolved-docstring-tokens

Conversation

@lyn1dev

@lyn1dev lyn1dev commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3069.

Several public classes and pore-scale model functions used %(...)s docstring substitution placeholders without applying the corresponding decorator, leaving raw template tokens in runtime __doc__ strings and generated Sphinx API pages:

  • openpnm.phase.Mercury: decorate with @docstr.dedent (Docorator) so %(Phase.parameters)s is expanded, matching Water and Air.
  • openpnm.models.geometry.pore_surface_area.cube, openpnm.models.geometry.pore_surface_area.square, and openpnm.models.geometry.throat_capillary_shape_factor.jenkins_rao: decorate with @_geodocs.
  • openpnm.models.physics.electrical_conductance.series_resistors, openpnm.models.physics.meniscus.general_toroidal, and openpnm.contrib.multiphase_diffusion: decorate with @_doctxt.

Adds a unit test in tests/unit/utils/UtilsTest.py verifying that all seven docstrings expand their substitutions and that no __all__-exported OpenPNM objects retain unresolved %(...)s tokens.

AI was used to write this code.

@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.9%. Comparing base (e7ab1f9) to head (97215f4).
⚠️ Report is 6 commits behind head on dev.

Additional details and impacted files
@@          Coverage Diff          @@
##             dev   #3085   +/-   ##
=====================================
  Coverage   87.9%   87.9%           
=====================================
  Files        151     151           
  Lines       8888    8899   +11     
=====================================
+ Hits        7818    7829   +11     
  Misses      1070    1070           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jgostick
jgostick merged commit 247b0f7 into PMEAL:dev Nov 26, 2026
16 checks passed
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.

API reference displays unresolved docstring substitution tokens

2 participants