Skip to content

Commit ea139fc

Browse files
committed
clean up vectors_yx
1 parent 44a2808 commit ea139fc

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

autoarray/structures/vectors/uniform.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import logging
22

3-
# import numpy as np
4-
from autofit.jax_wrapper import numpy as np, use_jax
3+
import numpy as np
4+
import jax.numpy as jnp
5+
# from autofit.jax_wrapper import numpy as np, use_jax
56
from typing import List, Optional, Tuple, Union
67

78
from autoarray.structures.arrays.uniform_2d import Array2D
@@ -396,11 +397,7 @@ def magnitudes(self) -> Array2D:
396397
"""
397398
Returns the magnitude of every vector which are computed as sqrt(y**2 + x**2).
398399
"""
399-
if use_jax:
400-
s = self.array
401-
else:
402-
s = self
403-
return Array2D(values=np.sqrt(s[:, 0] ** 2.0 + s[:, 1] ** 2.0), mask=self.mask)
400+
return Array2D(values=jnp.sqrt(self.array[:, 0] ** 2.0 + self.array[:, 1] ** 2.0), mask=self.mask)
404401

405402
@property
406403
def y(self) -> Array2D:

0 commit comments

Comments
 (0)