jonescompneurolab / hnn-core

Simulation and optimization of neural circuits for MEG/EEG source estimates
https://jonescompneurolab.github.io/hnn-core/
BSD 3-Clause "New" or "Revised" License
53 stars 52 forks source link

[BUG] net.add_poisson_drive() throws error for cell_specific=True depending on rate_constant type #816

Closed dylansdaniels closed 1 month ago

dylansdaniels commented 1 month ago

Testing add_poisson_drive() with {"rate_constant" = 2, "cell_specific"=True, "n_drive_cells" = "n_cells"} yields a TypeError, but not with {"rate_constant" = 2.0, "cell_specific"=True, "n_drive_cells" = "n_cells"}. This is related to #662

        event_times = np.array([])
        if drive_type == 'poisson':
            if target_type == 'any':
                rate_constant = dynamics['rate_constant']
>           elif target_type in dynamics['rate_constant']:
E           TypeError: argument of type 'int' is not iterable

hnn_core/drives.py:284: TypeError