Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit cc39eef

Browse files
author
Jaquier Aurélien Tristan
committed
Fix lfpy evaluator and lfpy test
1 parent eda3976 commit cc39eef

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

bluepyopt/tests/test_lfpy.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def test_lfpy_evaluator():
2323
"""Test CellEvaluator with an LFPy cell and LFPy simulator"""
2424

2525
evaluator = l5pc_lfpy_evaluator.create(
26-
feature_file=L5PC_LFPY_PATH + "/extra_features.json"
26+
feature_file=L5PC_LFPY_PATH + "/extra_features.json",
27+
cvode_active=False,
2728
)
2829

2930
responses = evaluator.run_protocols(
@@ -33,5 +34,5 @@ def test_lfpy_evaluator():
3334
values = evaluator.fitness_calculator.calculate_values(responses)
3435

3536
assert len(values) == 21
36-
assert abs(values['Step1.soma.AP_height'] - 28.1141131972856) < 1e-5
37+
assert abs(values['Step1.soma.AP_height'] - 27.85963902931001) < 1e-5
3738
assert len(responses['Step1.MEA.v']["voltage"]) == 40

examples/l5pc_lfpy/l5pc_lfpy_evaluator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def define_fitness_calculator(protocols, feature_file):
135135
return ephys.objectivescalculators.ObjectivesCalculator(objectives)
136136

137137

138-
def create(feature_file="extra_features.json"):
138+
def create(feature_file="extra_features.json", cvode_active=True):
139139
"""Setup"""
140140

141141
l5pc_cell = l5pc_lfpy_model.create()
@@ -147,7 +147,10 @@ def create(feature_file="extra_features.json"):
147147
param.name for param in l5pc_cell.params.values() if not param.frozen
148148
]
149149

150-
lfpy_sim = ephys.simulators.LFPySimulator(cvode_active=True)
150+
dt=None
151+
if cvode_active is False:
152+
dt=0.025
153+
lfpy_sim = ephys.simulators.LFPySimulator(cvode_active=cvode_active, dt=dt)
151154

152155
return ephys.evaluators.CellEvaluator(
153156
cell_model=l5pc_cell,

0 commit comments

Comments
 (0)