Repository navigation
Conversation
unwrap_expression returns a Python float for a bare constant expression in model units (V_w at 5 mm/yr gives 0.5), and the adjoint's scan of the boundary reads called .atoms on it: gradient() raised AttributeError when an essential condition's value was exactly one named constant. -V_w came back as a sympy Float, so a shortening box failed on the left wall only. The scan now sympifies the unwrapped element. test_0036 checks the gradient against central differences, with reference quantities and without; the case with them fails on development. Underworld development team with AI support from Claude Code
This branch has not been deployed
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.
What changes for users:
gradient()no longer raises when an essential condition's value is exactly one named constant, such asadd_dirichlet_bc((V_w, None), "Left")in a model with reference quantities.Found by H3 (the units desk, a Claude session) while converting the fault_friction example to explicit quantities. Runs were on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH), on development 4ab522a.
adjoint.pyis unchanged from there to this branch's base.The defect
unwrap_expressionreturns a Pythonfloatfor a bare constant expression in model units:V_wholding 5 mm/yr gives0.5._boundary_reads_ofinadjoint.pythen called.atomson it:-V_wcomes back as a sympyFloatand passes, so a shortening box failed on its left wall only. The scan now sympifies the unwrapped element: a one-line change.Test
tests/test_0036_adjoint_named_constant_datum.py, 2 tests: the gradient with respect to a viscosity knob, against central differences of the solve, with reference quantities and without. The case with reference quantities fails on development with the error above. The case without passes on both, because there the value is already a sympy number.Existing tests:
tests/test_002*.pyandtests/test_003*.py, the adjoint tests: 135 passed.scripts/check_test_coverage.pypasses.Checklist (UW3 Style Charter)
level_*andtier_*markers (S8)Underworld development team with AI support from Claude Code