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

[MRG] Poisson drive tests and bug fix for #662 #814

Closed dylansdaniels closed 1 month ago

dylansdaniels commented 1 month ago

This addresses issue #662 and includes a test for adding poisson drives to test_drives.py.

The test also yields an error with {"rate_constant" = 2, "cell_specific"=True, "n_drive_cells" = "n_cells"}, but not with {"rate_constant" = 2.0, "cell_specific"=True, "n_drive_cells" = "n_cells"}. I'll open a separate bug for this?

Test output:

        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
jasmainak commented 1 month ago

Set it to auto-merge. Thanks @dylansdaniels !

jasmainak commented 1 month ago

Thanks @dylansdaniels !! 🥳 🍺