Skip to content

Commit

Permalink
test data_loading
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGilardoni committed Oct 23, 2024
1 parent dbb9bcf commit 6d37c6a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_data_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ def __init__(self):

elif k in ['gexp', 'names', 'g']:
for k2 in data.sys[s].gexp.keys():
self.assertTrue((my_dict1[k][k2] == my_dict2[k][k2]).all())

# self.assertTrue((my_dict1[k][k2] == my_dict2[k][k2]).all())
self.assertTrue(np.array_equal(my_dict1[k][k2], my_dict2[k][k2]))
self.assertTrue(np.allclose(my_dict1[k][k2], my_dict2[k][k2]))

elif k in ['forward_qs']:
for k2 in data.sys[s].forward_qs.keys():
self.assertAlmostEqual(np.sum((my_dict1[k][k2] - my_dict2[k][k2])**2), 0)
Expand All @@ -111,7 +113,7 @@ def __init__(self):

if hasattr(loaded_data['_global_'], 'cycle_names'):
self.assertSetEqual(set(loaded_data['_global_'].cycle_names), set(data._global_.cycle_names))

for s in infos['global']['cycle_names']:

my_dict1 = vars(data.cycle[s])
Expand Down

0 comments on commit 6d37c6a

Please sign in to comment.