Skip to content

Commit

Permalink
fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGilardoni committed Nov 28, 2024
1 parent cdbb387 commit c22fe83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_loss_and_minimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ def assertEqualObjs(self, obj1, obj2):

print(obj1, obj2)

if isinstance(obj1, np.ndarray):
if obj1.shape == (1,): obj1 = obj1[0]
if isinstance(obj2, np.ndarray):
if obj2.shape == (1,): obj2 = obj2[0]

if isinstance(obj1, dict) and isinstance(obj2, dict):
self.assertSetEqual(set(obj1.keys()), set(obj2.keys()))
for k in obj1.keys():
Expand Down
5 changes: 5 additions & 0 deletions tests/test_mdrefinement.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ def assertEqualObjs(self, obj1, obj2, tol = 1e-4, if_relative = False):

print(obj1, obj2)

if isinstance(obj1, np.ndarray):
if obj1.shape == (1,): obj1 = obj1[0]
if isinstance(obj2, np.ndarray):
if obj2.shape == (1,): obj2 = obj2[0]

if isinstance(obj1, dict) and isinstance(obj2, dict):
self.assertSetEqual(set(obj1.keys()), set(obj2.keys()))
for k in obj1.keys():
Expand Down

0 comments on commit c22fe83

Please sign in to comment.