Skip to content

Commit

Permalink
adjusted tests to current torch setup, fixed numpy 2.x comp
Browse files Browse the repository at this point in the history
  • Loading branch information
TimRoith committed Oct 15, 2024
1 parent bd21021 commit 8eb397e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tests/dynamics/test_cbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import pytest
import numpy as np
from test_abstraction import test_abstract_dynamic
from cbx.utils.objective_handling import cbx_objective_fh
from cbx.utils.termination import max_it_term, energy_tol_term, max_eval_term, max_time_term

class Test_cbo(test_abstract_dynamic):
Expand Down Expand Up @@ -126,7 +125,7 @@ def norm_torch(x, axis, **kwargs):
x=x,
max_it=15,)
dyn.optimize()
assert dyn.x.shape == x.shape and not (dyn.x is x)
assert dyn.x.shape == x.shape and (dyn.x is not x)

def test_update_best_cur_particle(self, f, dynamic):
x = np.zeros((5,3,2))
Expand Down
3 changes: 1 addition & 2 deletions tests/dynamics/test_pdyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest
import numpy as np
from test_abstraction import test_abstract_dynamic
from cbx.utils.objective_handling import cbx_objective_fh
import scipy as scp

class Test_pdyn(test_abstract_dynamic):
Expand Down Expand Up @@ -76,7 +75,7 @@ def norm_torch(x, axis, **kwargs):
x=x,
max_it=15,)
dyn.optimize()
assert dyn.x.shape == x.shape and not (dyn.x is x)
assert dyn.x.shape == x.shape and (dyn.x is not x)


def test_mat_sqrt():
Expand Down

0 comments on commit 8eb397e

Please sign in to comment.