From 9972a220432364b9c998f08071ff453f8c9a3838 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 17 Feb 2022 07:58:56 +0100 Subject: [PATCH] precision is ok, but numpy.sum takes sum over all dimensions per default --- python/damask/_rotation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/_rotation.py b/python/damask/_rotation.py index 95c0b385a..1626312d1 100644 --- a/python/damask/_rotation.py +++ b/python/damask/_rotation.py @@ -1567,7 +1567,7 @@ class Rotation: +0.000059719705868660826, -0.00001980756723965647, +0.000003953714684212874, -0.00000036555001439719544]) hmag_squared = np.sum(ho**2.,axis=-1,keepdims=True) - s = sum([t*hmag_squared**i for i,t in enumerate(tfit)]) # np.sum fails due to higher precision + s = np.sum(np.array([t*hmag_squared**i for i,t in enumerate(tfit)]),0) with np.errstate(invalid='ignore'): ax = np.where(np.broadcast_to(np.abs(hmag_squared)<1.e-8,ho.shape[:-1]+(4,)), [ 0.0, 0.0, 1.0, 0.0 ],