You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sympy.Max/Min(UWexpression, plain number) crashes at construction: AttributeError '_prec' #415
Found by the #302 adversarial review (2026-07-24), pre-existing (reproduced identically on unmodified development):
k=uw.expression(r'k', 1.0, 'constant')
sympy.Max(k, 0.5) # AttributeError: 'UWexpression' object has no attribute '_prec'
UWexpression reports is_comparable=True, so sympy's Max/Min attempts an immediate numeric comparison and reaches for the Float internals (_prec) that a Symbol subclass doesn't have. The failure is loud (not a silent-bake hazard), but it blocks the natural way of writing clamped/floored constants — users must route through uw.maths.smooth_max or wrap differently.
Likely fix: UWexpression should not advertise is_comparable (it is symbolic until packed), or MathematicalMixin should intercept Max/Min construction. See src/underworld3/utilities/mathematical_mixin.py.
Underworld development team with AI support from Claude Code
Activity
JIT constants nested in wrapper expressions are live-rampable — revea…
Issue quick-fix batch 2: six small independent fixes (#415 #447 #413 #…
lmoresi commentedon Jul 28, 2026
Fixed by PR #456, merged to development on 2026-07-28. (Manual close — PRs target development, so auto-close doesn't fire.)