-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't enforce having cao_CR_GluSynapse when extracellular_calcium is set
- Loading branch information
Showing
3 changed files
with
60 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ nrnivmodl.log | |
.mypy_cache | ||
.ruff_cache | ||
.pytest_cache | ||
*.btr |
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,54 @@ | ||
from unittest import mock | ||
import pytest | ||
import bluecellulab | ||
from bluecellulab.circuit.config.sections import ConditionEntry, Conditions, MechanismConditions | ||
from bluecellulab.simulation.neuron_globals import set_global_condition_parameters, set_init_depleted_values, set_minis_single_vesicle_values, set_tstop_value | ||
|
||
|
||
def test_set_tstop_value(): | ||
set_tstop_value(100.0) | ||
assert bluecellulab.neuron.h.tstop == 100.0 | ||
|
||
|
||
@mock.patch("bluecellulab.neuron.h") | ||
def test_set_global_condition_parameters_no_mechs(mocked_h): | ||
del mocked_h.cao_CR_GluSynapse # delete the attribute for the mock | ||
calcium_condition = Conditions(extracellular_calcium=2.0) | ||
set_global_condition_parameters(calcium_condition) | ||
assert not hasattr(bluecellulab.neuron.h, "cao_CR_GluSynapse") | ||
|
||
mech_conditions = Conditions(mech_conditions=MechanismConditions(None, None, None)) | ||
set_global_condition_parameters(mech_conditions) | ||
|
||
|
||
@pytest.mark.v6 | ||
def test_set_global_condition_parameters(): | ||
calcium_condition = Conditions(extracellular_calcium=2.015) | ||
set_global_condition_parameters(calcium_condition) | ||
assert bluecellulab.neuron.h.cao_CR_GluSynapse == 2.015 | ||
|
||
|
||
@pytest.mark.v6 | ||
def test_set_init_depleted_values(): | ||
mech_conditions = MechanismConditions( | ||
ampanmda=ConditionEntry(minis_single_vesicle=None, init_depleted=True), | ||
gabaab=ConditionEntry(minis_single_vesicle=None, init_depleted=False), | ||
glusynapse=ConditionEntry(minis_single_vesicle=None, init_depleted=None), | ||
) | ||
set_init_depleted_values(mech_conditions) | ||
assert bluecellulab.neuron.h.init_depleted_ProbAMPANMDA_EMS == 1.0 | ||
assert bluecellulab.neuron.h.init_depleted_ProbGABAAB_EMS == 0.0 | ||
assert bluecellulab.neuron.h.init_depleted_GluSynapse == 0.0 | ||
|
||
|
||
@pytest.mark.v6 | ||
def test_set_minis_single_vesicle_values(): | ||
mech_conditions = MechanismConditions( | ||
ampanmda=ConditionEntry(minis_single_vesicle=True, init_depleted=None), | ||
gabaab=ConditionEntry(minis_single_vesicle=False, init_depleted=None), | ||
glusynapse=ConditionEntry(minis_single_vesicle=None, init_depleted=None), | ||
) | ||
set_minis_single_vesicle_values(mech_conditions) | ||
assert bluecellulab.neuron.h.minis_single_vesicle_ProbAMPANMDA_EMS == 1.0 | ||
assert bluecellulab.neuron.h.minis_single_vesicle_ProbGABAAB_EMS == 0.0 | ||
assert bluecellulab.neuron.h.minis_single_vesicle_GluSynapse == 0.0 |