From f0bfec473d77a0d6e47202a4ef56f18b53272fb3 Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Mon, 26 Jan 2026 10:08:10 +0100 Subject: [PATCH] fix: compat with old numpy --- src/ess/beer/io.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ess/beer/io.py b/src/ess/beer/io.py index 464961ec..9c545c4d 100644 --- a/src/ess/beer/io.py +++ b/src/ess/beer/io.py @@ -23,7 +23,9 @@ def _rotation_from_y_rotation_matrix(rot): '''Assuming the rotation is around the y-axis this function creates a rotation operator from the rotation matrix.''' - angle = np.atan2(rot[2, 0], rot[0, 0]) + # Numpy backwards compatibility. + atan2 = np.atan2 if hasattr(np, 'atan2') else np.arctan2 + angle = atan2(rot[2, 0], rot[0, 0]) return sc.spatial.rotation( value=[ 0.0,