Skip to content

Commit

Permalink
WiP test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt-Brunner committed Dec 2, 2024
1 parent 5ba9b84 commit e6edeee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions napytau/core/chi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from napytau.core.polynomials import polynomial_sum_at_measuring_times
from napytau.core.polynomials import differentiated_polynomial_sum_at_measuring_times
from numpy import sum
from numpy import array
from numpy import ndarray
from numpy import mean
from numpy import power
Expand Down Expand Up @@ -141,9 +140,9 @@ def chi_squared_t_hyp(t_hyp: float) -> float:
delta_doppler_shifted_intensities,
delta_unshifted_intensities,
time,
initial_coefficients,
t_hyp,
weight_factor,
initial_coefficients,
)[1]

# minimize chi-squared function over the range of t_hyp
Expand Down
8 changes: 3 additions & 5 deletions tests/core/chi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
from numpy import testing
from scipy.optimize import OptimizeResult

from napytau.core.chi import chi_squared_fixed_t


def set_up_mocks() -> (MagicMock, MagicMock, MagicMock):
def set_up_mocks() -> (MagicMock, MagicMock):
polynomials_mock = MagicMock()
polynomials_mock.polynomial_sum_at_measuring_times = MagicMock()
polynomials_mock.differentiated_polynomial_sum_at_measuring_times = MagicMock()
Expand All @@ -33,7 +30,7 @@ def test_ChiCalculationForValidData(self):
{
"napytau.core.polynomials": polynomials_mock,
},
):
):

from napytau.core.chi import chi_squared_fixed_t

Expand Down Expand Up @@ -543,6 +540,7 @@ def test_coefficientOptimization(self):
):

from napytau.core.chi import optimize_coefficients
from napytau.core.chi import chi_squared_fixed_t

# Mocked input data
doppler_shifted_intensities: array = array([2, 6])
Expand Down

0 comments on commit e6edeee

Please sign in to comment.