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
conform7 VCV propagation raises ValueError with NumPy ≥ 2.x #181
When a vcv is passed to conform7 and the transformation has a tf_sd, the call fails while building the Jacobian. Every function that calls conform7 with a vcv fails too: conform14, plate_motion_transformation, transform_atrf2014_to_gda2020 and transform_gda2020_to_atrf2014, and both MGA94↔MGA2020 functions.
TypeError: only 0-dimensional arrays can be converted to Python scalars
...
File "geodepy/transform.py", line 98, in conform7
j_mat[0, 3] = rot_xyz[0]
ValueError: setting an array element with a sequence.
Environment: NumPy 2.4.2, Python 3.14.
Cause
xyz_before and rot_xyz are 3×1 column vectors, so rot_xyz[0] and xyz_before[2] return 1-element arrays of shape (1,) rather than scalars. Assigning them to single cells of j_mat (transform.py:98-108) depended on NumPy converting size-1 arrays to scalars implicitly. NumPy deprecated that in 1.25 and now raises an error. The transformed coordinates are unaffected because lines 59–61 already index with [i][0].
The existing tests didn't catch this because none of them passes a vcv.
Proposed fix
Index the scalars explicitly (rot_xyz[i, 0], xyz_before[i, 0]), or work with 1-D vectors throughout:
Activity