Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Aug 2, 2024
1 parent ebc5114 commit d4421fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unit/test_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,15 @@ def test_weighted_fitting_cost(self, noisy_problem):

# Test MAP explicitly
cost4 = pybop.MAP(problem, pybop.GaussianLogLikelihood)
weighted_cost_4 = pybop.WeightedCost(cost1, cost4, weights=[1, -1/weight])
weighted_cost_4 = pybop.WeightedCost(cost1, cost4, weights=[1, -1 / weight])
assert weighted_cost_4.has_identical_problems is False
assert weighted_cost_4.has_separable_problem is False
sigma = 0.01
assert np.isfinite(cost4.parameters["Sigma for output 1"].prior.logpdf(sigma))
assert np.isfinite(weighted_cost_4([0.5, sigma]))
np.testing.assert_allclose(
weighted_cost_4.evaluate([0.6, sigma]),
cost1([0.6, sigma]) -1/ weight * cost4([0.6, sigma]),
cost1([0.6, sigma]) - 1 / weight * cost4([0.6, sigma]),
atol=1e-5,
)

Expand Down

0 comments on commit d4421fe

Please sign in to comment.