Skip to content

Commit 39fbf72

Browse files
committed
unit tests fixed
1 parent 340c34d commit 39fbf72

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

autoarray/fit/fit_util.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ def chi_squared_complex_from(*, chi_squared_map: jnp.ndarray) -> float:
158158
chi_squared_map
159159
The chi-squared-map of values of the model-data fit to the dataset.
160160
"""
161-
chi_squared_real = jnp.sum(chi_squared_map.real)
162-
chi_squared_imag = jnp.sum(chi_squared_map.imag)
161+
chi_squared_real = jnp.sum(np.array(chi_squared_map.real))
162+
chi_squared_imag = jnp.sum(np.array(chi_squared_map.imag))
163163
return chi_squared_real + chi_squared_imag
164164

165165

@@ -174,8 +174,8 @@ def noise_normalization_complex_from(*, noise_map: jnp.ndarray) -> float:
174174
noise_map
175175
The masked noise-map of the dataset.
176176
"""
177-
noise_normalization_real = jnp.sum(jnp.log(2 * jnp.pi * noise_map.real**2.0))
178-
noise_normalization_imag = jnp.sum(jnp.log(2 * jnp.pi * noise_map.imag**2.0))
177+
noise_normalization_real = jnp.sum(jnp.log(2 * jnp.pi * np.array(noise_map).real**2.0))
178+
noise_normalization_imag = jnp.sum(jnp.log(2 * jnp.pi * np.array(noise_map).imag**2.0))
179179
return noise_normalization_real + noise_normalization_imag
180180

181181

0 commit comments

Comments
 (0)