Skip to content

docs: audit and clarify all function docstrings - #462

Merged
edkerk merged 2 commits into
develop4from
docs/audit-all-docstrings
Aug 30, 2026
Merged

docs: audit and clarify all function docstrings#462
edkerk merged 2 commits into
develop4from
docs/audit-all-docstrings

Conversation

@edkerk

@edkerk edkerk commented Aug 29, 2026

Copy link
Copy Markdown
Member

Full pass over every header docstring in src/geckomat, test/, and
tutorials/, following up on #459/#460/#461. Goal: a docstring should tell
a reader what the function produces and what its inputs do, without
narrating implementation history or repeating itself. Comment/docstring
only -- no functional changes, verified by a full 46/46 unit test pass.

Recurring patterns fixed across many files:

  • A one-line summary immediately followed by a paragraph that just restates
    it (findMetSmiles, findECInDB, runDLKcat, loadFluxData,
    getConcControlCoeffs, abc_max, findMaxValue, sensitivityTuning,
    sigmaFitter, truncateValues, and others).
  • Returns/argument descriptions that no longer matched the code: wrong
    struct field names in kcatList (fuzzyKcatMatching, readDLKcatOutput,
    selectKcatValue), a vague "table"/"struct" return with no indication of
    its actual columns/fields (applyComplexData, applyCustomKcats,
    mergeKcats, mergeDLKcatAndFuzzyKcats, updateProtPool), an inaccurate
    threshold (applyCustomKcats: code uses >= 50%, not > 50%), and a
    docstring that predated the KEGG-fallback path added later in the same
    function (makeEcModel).
  • Historical/regression narration replaced with a plain statement of
    current behavior: loadBRENDAdata's "previous, single-aggregate
    behaviour" note, relaxProteomicsGreedy's porting/attribution paragraph,
    updateProtPool's "Obsolete since / Before GECKO 3.2.0" framing (now
    states when the function errors instead), pfbaEnzymes's
    geckopy-attribution and implementation-detail asides, and 32 of the
    46 tests in geckoCoreFunctionTests.m whose docstrings were empty
    (%full) or long bug-regression narratives (RAVEN/PR/issue references,
    "used to...", "cross-verified against geckopy" framing) -- rewritten to
    state the scenario each test verifies.
  • Tutorial/adapter scripts: changeMedia was missing two documented
    parameters and mis-described two others (anox isn't boolean, flux
    isn't a cell array); scaleBioMass_GECKO mis-described its own default
    behavior; light_ecModel/protocol.m's header wrongly described the
    full yeast-GEM model instead of the light Human-GEM one it actually
    covers.

Functions found with no docstring at all (mostly small local helpers, plus
ModelAdapter/ModelAdapterManager's methods and GECKOInstaller's
static methods) were left untouched rather than given an invented one --
out of scope for a wording/accuracy pass.

edkerk added 2 commits August 30, 2026 00:47
- calculateMW: state the MW unit (Da) explicitly.
- reportEnzymeUsage: remove the redundant repeated summary line, tighten
  the highCapUsage/topAbsUsage descriptions, document that topAbsUsage
  omits enzymes with no flux-carrying reactions, and correct the Returns
  section to describe the actual struct fields (it previously just said
  "table with summary information", but usageReport is a struct with
  two tables and a scalar).
… and tutorials

Reviewed every top-level function's header docstring for clarity and
accuracy. Removed redundant summaries that just restated the one-line
header, dropped historical/regression narration and cross-implementation
comparisons in favor of stating current behavior plainly, fixed several
docstrings that no longer matched the code (wrong struct field names,
wrong defaults, wrong thresholds, stale claims predating later changes),
and clarified vague Parameters/Returns descriptions.

Docstring/comment-only; no functional changes. Full unit test suite
(46/46) passes unchanged.
@github-actions

Copy link
Copy Markdown

Unit test results

46 tests   46 ✅  9s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 7dd3aad.

@edkerk
edkerk merged commit f02bae0 into develop4 Aug 30, 2026
2 checks passed
@edkerk
edkerk deleted the docs/audit-all-docstrings branch August 30, 2026 22:10
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