Repository navigation
1.9.x train 2026-11-14: mprans modules import what they use (import-order fix) - #1362
Merged
Merged
Conversation
Dissipation, Kappa, NCLS, RDLS, SW2D and MCorr do `import proteus` and then name proteus.SubgridError, proteus.StepControl and others as attributes, which works only if something else imported them first. One pytest process per file (the LSU QB 1.9.1 module tests) showed it: test_cython_class_attributes [proteus.mprans.MCorr] failed with "module 'proteus' has no attribute 'StepControl'". Ports cfe3611 (five modules) and main's MCorr imports. New test/test_mprans_import_isolation.py imports each of the 30 proteus.mprans modules in its own subprocess. Before (1.9.x d1c4fe2, 30 modules, each alone): 6 fail, 24 pass. Dissipation, Kappa, NCLS, RDLS, SW2D: AttributeError, module 'proteus' has no attribute 'SubgridError' MCorr: ImportError (macOS) symbol not found '_dgesc2_', once the missing imports were added after cfemIntegrals; it needs them before it (see below). After: 30/30 pass (local macOS arm64, env proteus-hotstart-261025, PYTHONPATH=worktree, seeded extensions). Import placement: after each file's existing imports (as cfe3611), except MCorr, whose first import is cfemIntegrals, which does not link LAPACK itself; there the block goes right after `import proteus`, with proteus.Transport first, so LAPACK is loaded before cfemIntegrals. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
This pull request was reviewed, and passed CI, as its own pull request on cekees/proteus. This branch merges it onto
1.9.xat d1c4fe2 with one merge commit.Merge with "Create a merge commit", not squash or rebase, so the commit keeps its hash and the fork's pull request closes itself.
Six of the 30
proteus.mpransmodules failed onimportin a fresh interpreter: Dissipation, Kappa, NCLS, RDLS and SW2D withAttributeError, MCorr with anImportErroron macOS (_dgesc2_). They usedproteus.Xattributes without importingX, so they worked only when something else had imported it first, as in a fullparunrun. The change ports the five imports from main (cfe3611), makes MCorr importproteus.TransportbeforecfemIntegrals, and addstest/test_mprans_import_isolation.py, which imports each module in its own process (30 of 30 pass).The same guard test goes to main in a separate pull request, since main already has the imports.
Diff against
1.9.x: 7 files changed, 97 insertions(+).🤖 Generated with Claude Code