From c79813c0c84734427dda60a351420088cddcb77b Mon Sep 17 00:00:00 2001 From: dylansdaniels-berkeley Date: Wed, 10 Jul 2024 15:59:46 -0400 Subject: [PATCH] fix for add_poisson_drive not working with int when cell_specific=True --- hnn_core/network.py | 2 +- hnn_core/tests/test_drives.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hnn_core/network.py b/hnn_core/network.py index bda422475..3b9ae3488 100644 --- a/hnn_core/network.py +++ b/hnn_core/network.py @@ -745,7 +745,7 @@ def add_poisson_drive(self, name, *, tstart=0, tstop=None, rate_constant, f"n_drive_cells='n_cells'. Got cell_specific" f" cell_specific={cell_specific} and " f"n_drive_cells={n_drive_cells}.") - elif isinstance(rate_constant, float): + elif isinstance(rate_constant, (float, int)): if cell_specific: rate_constant = {cell_type: rate_constant for cell_type in target_populations} diff --git a/hnn_core/tests/test_drives.py b/hnn_core/tests/test_drives.py index 58f4b9bbc..5212bfa66 100644 --- a/hnn_core/tests/test_drives.py +++ b/hnn_core/tests/test_drives.py @@ -469,6 +469,7 @@ def test_drive_random_state(): @pytest.mark.parametrize("rate_constant,cell_specific,n_drive_cells", [(2, False, 1), (2.0, False, 1), + (2, False, 1), (2.0, False, 1), ]) def test_add_poisson_drive(setup_net, rate_constant, cell_specific, n_drive_cells):