Repository navigation
Drop trailing commas that made five argsDict values 1-tuples - #44
Merged
Merged
Conversation
`argsDict["k"] = arr,` stores (arr,). proteus::pyarray rejects a tuple, so each of these raised TypeError from ArgumentsDict.__setitem__ the first time its method ran: - m_comp_co2.LevelModel.getResidual / getJacobian: elementMaterialTypes - RANS2P_IB.LevelModel.getJacobian / beamStep: elementDiameter - SW2D.LevelModel.getJacobian: elementDiameter All five are unconditional, so every run of these models failed on its first residual or Jacobian. Nothing in test/ runs m_comp_co2, RANS2P_IB or SW2D. 27c00b0 fixed the other eleven; the RANS2P_IB and SW2D lines have a comment after the comma, which a line-end grep for "," misses, and m_comp_co2 was merged the day after (82ce489). test/test_argsdict_values.py walks the installed proteus sources with ast and rejects any tuple, list, set, dict, comprehension, None or string assigned into an ArgumentsDict, so no future occurrence depends on a model having a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
argsDict["k"] = arr,stores the 1-tuple(arr,). On main,proteus::pyarrayrejects tuples, so each of these raisedTypeError: __setitem__(): incompatible function argumentsthe first time its method ran:proteus/m_comp_co2/m_comp_co2.py:3830LevelModel.getResidualelementMaterialTypesproteus/m_comp_co2/m_comp_co2.py:4677LevelModel.getJacobianelementMaterialTypesproteus/mprans/RANS2P_IB.py:1343LevelModel.getJacobianelementDiameterproteus/mprans/RANS2P_IB.py:1574LevelModel.beamStepelementDiameterproteus/mprans/SW2D.py:825LevelModel.getJacobianelementDiameterNone of these is behind a condition, so every run of m_comp_co2, RANS2P_IB or SW2D failed on its first residual or Jacobian evaluation. They went unnoticed because nothing in
test/orproteus/tests/runs any of the three models.27c00b0 fixed the other eleven occurrences listed in the report (PresInc, RANS2P_IB
sdInfo_u_w_rowptr, RANS3PF, RANS3PSed, richards/ADR, Richards). It missed these five for two reasons: the RANS2P_IB and SW2D lines have a# commentafter the comma, which a line-end grep misses, and m_comp_co2 was merged the next day (82ce489).Guard
test/test_argsdict_values.pyparses every.pyunder the installedproteuspackage withast. It fails on any tuple, list, set, dict, comprehension,Noneor string assigned intoargsDict[...]or into any name bound toArgumentsDict(). The check doesn't depend on a model having a test, and it handles comments and multi-line values. A second test feeds the scanner a synthetic snippet, so the scanner can't silently stop matching.Verified locally: both tests pass on this branch. The scan fails on unfixed
origin/main(exactly these 5 sites) and on unfixedorigin/1.9.x(12 sites plus ADR.py).Companion 1.9.x PR: #45.
🤖 Generated with Claude Code