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
Writing a unit-aware array to SwarmVariable.array stores its magnitude as non-dimensional #993
Writing a unit-aware array to SwarmVariable.array stores its magnitude as non-dimensional, so a round trip multiplies storage by the scale, with no error (p20_unit_array.py, p26_unitarray.py, np 1 and 2).
T in K, stored raw 0.5, .array reads 500 K:
v.array = UnitAwareArray(500 K): .data becomes 500, where 0.5 is right.
v.array = np.asarray(v.array): .data becomes 500.
Seen on scalar, vector, MATRIX, TENSOR and SYM_TENSOR swarm variables. #788 is a related store of dimensional magnitudes, in viscoelastic history.
Found in the third review of the #909 branch. Measured on eddab70 (development before #954 to #973, which do not touch these paths) unless stated; not rerun on f31edcb. Probes on hyperion in runs/2026-11-06/review909r3/probes/.
Part of the units bundle the hub is recording for one owner: #979, and the issues linked below.
Underworld development team with AI support from Claude Code
Still live on development 8f0ed0a (H3 units re-verification). Scalar, vector, MATRIX, TENSOR and SYM_TENSOR swarm variables in K, stored 0.5: after v.array = UnitAwareArray(500 K) or v.array = np.asarray(v.array), .data reads 500, where 0.5 is right.
The cause: SwarmVariable.array's setter (swarm.py) reshapes the value and writes it straight into .data, skipping the unit conversion that the view's __setitem__ performs. MeshVariable.array's setter routes through self.array[...] = value instead. The fix is to do the same.
Scripts: runs/2026-11-10-h3/probes/p20_unit_array.py and p26_unitarray.py on hyperion.
Underworld development team with AI support from Claude Code
Fixed in development by #1205 (units PR 2), merge commit 04d6f84. The PR body gives the change for this issue and the test that fails on development without it. H1 checked each reproducer, at np 1 to 4 where the issue is parallel. The issue stays open until the release.
Underworld development team with AI support from Claude Code
Activity
lmoresi commentedon Nov 10, 2026
Still live on development 8f0ed0a (H3 units re-verification). Scalar, vector, MATRIX, TENSOR and SYM_TENSOR swarm variables in K, stored 0.5: after
v.array = UnitAwareArray(500 K)orv.array = np.asarray(v.array),.datareads 500, where 0.5 is right.The cause:
SwarmVariable.array's setter (swarm.py) reshapes the value and writes it straight into.data, skipping the unit conversion that the view's__setitem__performs.MeshVariable.array's setter routes throughself.array[...] = valueinstead. The fix is to do the same.Scripts:
runs/2026-11-10-h3/probes/p20_unit_array.pyandp26_unitarray.pyon hyperion.Underworld development team with AI support from Claude Code
Merge pull request #1205 from underworldcode/units/frame-defects
lmoresi commentedon Nov 16, 2026
Fixed in development by #1205 (units PR 2), merge commit 04d6f84. The PR body gives the change for this issue and the test that fails on development without it. H1 checked each reproducer, at np 1 to 4 where the issue is parallel. The issue stays open until the release.
Underworld development team with AI support from Claude Code
Generated by Claude Code
SwarmVariable.array: write through the view, which converts units (un…
SwarmVariable.array: accept shapes that differ only by length-one axes (