Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] add drive warnings #516

Merged
merged 7 commits into from
Oct 1, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ Changelog
- Add interface to modify attributes of sections in
:func:`~hnn_core.Cell.modify_section`, by `Nick Tolley`_ in :gh:`481`

- Add ability to target specific sections when adding drives or connections,
by `Nick Tolley`_ in :gh:`419`
- Add ability to target specific sections when adding drives or connections,
by `Nick Tolley`_ in :gh:`419`

- Runtime output messages now specify the trial with which each simulation time
checkpoint belongs too, by `Ryan Thorpe`_ in :gh:`546`.

- Add warning if network drives are not loaded, by `Orsolya Beatrix Kolozsvari`_ in :gh:`#516`
orbekolo marked this conversation as resolved.
Show resolved Hide resolved

Bug
~~~
- Fix bugs in drives API to enable: rate constant argument as float; evoked drive with
Expand Down Expand Up @@ -340,6 +342,7 @@ People who contributed to this release (in alphabetical order):
.. _Mattan Pelah: https://github.com/mjpelah
.. _Mohamed A. Sherif: https://github.com/mohdsherif/
.. _Nick Tolley: https://github.com/ntolley
.. _Orsolya Beatrix Kolozsvari: http://github.com/orbekolo/
.. _Ryan Thorpe: https://github.com/rythorpe
.. _Samika Kanekar: https://github.com/samikane
.. _Sarah Pugliese: https://bcs.mit.edu/directory/sarah-pugliese
Expand Down
3 changes: 3 additions & 0 deletions hnn_core/dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def simulate_dipole(net, tstop, dt=0.025, n_trials=None, record_vsoma=False,
'net = jones_2009_model() or net = law_2021_model() to '
'create a predefined network from published models.',
UserWarning)
# ADD DRIVE WARNINGS HERE
if not net.external_drives:
warnings.warn('No external drives loaded', UserWarning)

for drive_name, drive in net.external_drives.items():
if 'tstop' in drive['dynamics']:
Expand Down
4 changes: 4 additions & 0 deletions hnn_core/tests/test_drives.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ def test_add_drives():
synaptic_delays={'L2_pyramidal': 1.},
probability={'L2_pyramidal': 2.0})

with pytest.warns(UserWarning, match='No external drives loaded'):
net.clear_drives()
simulate_dipole(net, tstop=10)


def test_drive_random_state():
"""Tests to check same random state always gives same spike times."""
Expand Down