Skip to content

Commit

Permalink
fix for add_poisson_drive not working with int when cell_specific=True
Browse files Browse the repository at this point in the history
  • Loading branch information
dylansdaniels committed Jul 10, 2024
1 parent 1aa6cbd commit c79813c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hnn_core/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions hnn_core/tests/test_drives.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c79813c

Please sign in to comment.