-
Notifications
You must be signed in to change notification settings - Fork 52
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] BUG: Update gid_ranges
after using clear_drives
#812
Changes from 7 commits
db9dbf6
71f6690
c8c703c
87378f6
bd428ce
56ec9d6
c21c332
c9c7c23
787bc57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,8 +98,8 @@ def test_external_drive_times(): | |
def test_drive_seeds(setup_net): | ||
"""Test that unique spike times are generated across trials""" | ||
net = setup_net | ||
weights_ampa = {'L2_basket': 0.000003, 'L2_pyramidal': 1.438840, | ||
'L5_basket': 0.008958, 'L5_pyramidal': 0.684013} | ||
weights_ampa = {'L2_basket': 0.3, 'L2_pyramidal': 0.3, | ||
'L5_basket': 0.3, 'L5_pyramidal': 0.3} | ||
synaptic_delays = {'L2_basket': 0.1, 'L2_pyramidal': 0.1, | ||
'L5_basket': 1., 'L5_pyramidal': 1.} | ||
net.add_evoked_drive( | ||
|
@@ -116,6 +116,32 @@ def test_drive_seeds(setup_net): | |
assert ~np.any(np.allclose(trial1_spikes, trial2_spikes)) | ||
|
||
|
||
def test_clear_drives(setup_net): | ||
"""Test clearing drives updates Network""" | ||
net = setup_net | ||
weights_ampa = {'L5_pyramidal': 0.3} | ||
synaptic_delays = {'L5_pyramidal': 1.} | ||
|
||
n_gids = net._n_gids | ||
net.add_evoked_drive( | ||
gtdang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'prox', mu=40, sigma=8.33, numspikes=1, | ||
weights_ampa=weights_ampa, location='proximal', | ||
synaptic_delays=synaptic_delays, cell_specific=True) | ||
|
||
assert len(net.external_drives) > 0 | ||
assert 'prox' in net.external_drives | ||
assert 'prox' in net.gid_ranges | ||
assert 'prox' in net.pos_dict | ||
assert net._n_gids == n_gids + len(net.gid_ranges['L5_pyramidal']) | ||
|
||
net.clear_drives() | ||
assert len(net.external_drives) == 0 | ||
assert 'prox' not in net.external_drives | ||
assert 'prox' not in net.gid_ranges | ||
assert 'prox' not in net.pos_dict | ||
assert net._n_gids == n_gids | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps we can test adding a new drive after clearing drives to make sure the Network still works after clearing the drives? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mostly a check that the ranges and positions are populated as expected after resetting them. |
||
|
||
def test_add_drives(): | ||
"""Test methods for adding drives to a Network.""" | ||
hnn_core_root = op.dirname(hnn_core.__file__) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a matter of semantics but are drive names also "cell types"? I think in other parts of the codebase "cell_types" usually just refers to the neocortical cell names? At least the Network["cell_types"] is only those cells. Maybe something like "range_name" would be clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we have a bit of inconsistency here ... how about calling it
cell_name
like we do in the rest of the repo. The variable namecell_type
andcell_template
are a bit interchangeable and confusing