Skip to content

Commit

Permalink
extend dtype test
Browse files Browse the repository at this point in the history
  • Loading branch information
lueckem committed Sep 2, 2024
1 parent 0611e24 commit 0c50a09
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/tests_cnvm/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,26 @@ def test_output_dtype(self):
correct_dtype_list = [np.uint8, np.uint16]

for num_opinions, correct_dtype in zip(num_opinions_list, correct_dtype_list):
# complete network
params = CNVMParameters(
num_opinions=num_opinions,
num_agents=self.num_agents,
r=1,
r_tilde=1,
)

model = CNVM(params)
t_max = 5
t, x = model.simulate(t_max)
self.assertEqual(correct_dtype, x.dtype)

# network
params = CNVMParameters(
num_opinions=num_opinions,
network=nx.barabasi_albert_graph(self.num_agents, 2),
r=1,
r_tilde=1,
)
model = CNVM(params)
t_max = 5
t, x = model.simulate(t_max)
self.assertEqual(correct_dtype, x.dtype)

0 comments on commit 0c50a09

Please sign in to comment.