From 0c50a094c0fd114a4642d6b50663507115b530ce Mon Sep 17 00:00:00 2001 From: Marvin Date: Mon, 2 Sep 2024 13:56:07 +0200 Subject: [PATCH] extend dtype test --- tests/tests_cnvm/test_model.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/tests_cnvm/test_model.py b/tests/tests_cnvm/test_model.py index c94564b..ffebd66 100644 --- a/tests/tests_cnvm/test_model.py +++ b/tests/tests_cnvm/test_model.py @@ -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)