return scalar for None, not one-point array

This commit is contained in:
Martin Diehl 2022-03-18 09:06:48 +01:00
parent a0b63c029b
commit 4972c43b17
2 changed files with 4 additions and 4 deletions

@ -1 +1 @@
Subproject commit 459326e9840c843ade72b04cf28e50889c9779f1 Subproject commit 00b3eb79ee6f8df2ca50276d2111008e5f79b3e1

View File

@ -1064,7 +1064,7 @@ class Rotation:
dV_V = dg * np.maximum(0.0,weights.squeeze()) dV_V = dg * np.maximum(0.0,weights.squeeze())
N = 1 if shape is None else np.prod(shape) N = 1 if shape is None else np.prod(shape)
return Rotation.from_Euler_angles(phi[util.hybrid_IA(dV_V,N,rng_seed)],degrees).reshape((-1,) if shape is None else shape) return Rotation.from_Euler_angles(phi[util.hybrid_IA(dV_V,N,rng_seed)],degrees).reshape(() if shape is None else shape)
@staticmethod @staticmethod
@ -1106,7 +1106,7 @@ class Rotation:
np.sqrt(1-u**2)*np.sin(Theta), np.sqrt(1-u**2)*np.sin(Theta),
u, omega]) u, omega])
return Rotation.from_axis_angle(p).reshape((-1,) if shape is None else shape) * center return Rotation.from_axis_angle(p).reshape(() if shape is None else shape) * center
@staticmethod @staticmethod
@ -1165,7 +1165,7 @@ class Rotation:
return (R_align.broadcast_to(N) return (R_align.broadcast_to(N)
* Rotation.from_axis_angle(p,normalize=True) * Rotation.from_axis_angle(p,normalize=True)
* Rotation.from_axis_angle(f)).reshape((-1,) if shape is None else shape) * Rotation.from_axis_angle(f)).reshape(() if shape is None else shape)
#################################################################################################### ####################################################################################################