-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: Stop rxd.Region keeping sections alive when they go out of sc…
…ope. (#1072) * bugfix: Stop rxd.Region keeping sections alive when they go out of scope. * Update test_region_sections.py * Prevent species from keeping sections alive. * Updated following @ramcdougal review. * Remove deleted section from rxd. * Additional check and Simplify test.
- Loading branch information
1 parent
9f4b878
commit f107ff9
Showing
4 changed files
with
127 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
|
||
def test_region_sections(neuron_instance): | ||
"""A test that regions and species do not keep sections alive""" | ||
|
||
h, rxd, data, save_path = neuron_instance | ||
soma = h.Section(name='soma') | ||
cyt = rxd.Region(soma.wholetree(), name='cyt') | ||
ca = rxd.Species(cyt, name='ca', charge=2) | ||
h.finitialize(-65) | ||
soma = None | ||
|
||
for sec in h.allsec(): | ||
assert(False) | ||
|
||
def test_section_removal(neuron_instance): | ||
"""A test that deleted sections are removed from rxd""" | ||
|
||
h, rxd, data, save_path = neuron_instance | ||
soma = h.Section(name='soma') | ||
cyt = rxd.Region(soma.wholetree(), name='cyt') | ||
ca = rxd.Species(cyt, name='ca', charge=2) | ||
h.finitialize(-65) | ||
|
||
soma = h.Section(name='soma') | ||
h.finitialize(-65) | ||
|
||
assert(not ca.nodes) |