@@ -53,7 +53,7 @@ def __init__(self, *args, **kwargs):
5353 self ._g = g1 + 1j * g2
5454 self ._g = equinox .error_if (
5555 self ._g ,
56- jnp .abs (self ._g ) > 1.0 ,
56+ jnp .any ( jnp . abs (self ._g ) > 1.0 ) ,
5757 "Requested shear exceeds 1." ,
5858 )
5959
@@ -64,7 +64,7 @@ def __init__(self, *args, **kwargs):
6464 absesq = e1 ** 2 + e2 ** 2
6565 absesq = equinox .error_if (
6666 absesq ,
67- absesq > 1.0 ,
67+ jnp . any ( absesq > 1.0 ) ,
6868 "Requested distortion exceeds 1." ,
6969 )
7070 self ._g = (e1 + 1j * e2 ) * self ._e2g (absesq )
@@ -91,7 +91,7 @@ def __init__(self, *args, **kwargs):
9191 g = jnp .array (kwargs .pop ("g" ))
9292 g = equinox .error_if (
9393 g ,
94- g > 1 or g < 0 ,
94+ jnp . any (( g > 1 ) | ( g < 0 )) ,
9595 "Requested |shear| is outside [0,1]." ,
9696 )
9797 self ._g = g * jnp .exp (2j * beta .rad )
@@ -110,7 +110,7 @@ def __init__(self, *args, **kwargs):
110110 e = jnp .array (kwargs .pop ("e" ))
111111 e = equinox .error_if (
112112 e ,
113- ( e > 1 ) | (e < 0 ),
113+ jnp . any (( e > 1 ) | (e < 0 ) ),
114114 "Requested distortion is outside [0,1]." ,
115115 )
116116 self ._g = self ._e2g (e ** 2 ) * e * jnp .exp (2j * beta .rad )
@@ -129,7 +129,7 @@ def __init__(self, *args, **kwargs):
129129 eta = jnp .array (kwargs .pop ("eta" ))
130130 eta = equinox .error_if (
131131 eta ,
132- eta < 0 ,
132+ jnp . any ( eta < 0 ) ,
133133 "Requested eta is below 0." ,
134134 )
135135 self ._g = self ._eta2g (eta ) * eta * jnp .exp (2j * beta .rad )
@@ -148,7 +148,7 @@ def __init__(self, *args, **kwargs):
148148 q = jnp .array (kwargs .pop ("q" ))
149149 q = equinox .error_if (
150150 q ,
151- ( q <= 0 ) | (q > 1 ),
151+ jnp . any (( q <= 0 ) | (q > 1 ) ),
152152 "Cannot use requested axis ratio." ,
153153 )
154154 eta = - jnp .log (q )
0 commit comments