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

replace deprecated efel usages #124

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bluepyemodel/access_point/access_point.py
Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ def get_available_mechanisms(self):
def get_available_efeatures(self, cleaned=True):
"""Returns a curated list of available eFEL features"""

efel_features = efel.getFeatureNames()
efel_features = efel.get_feature_names()

if not cleaned:
return efel_features
4 changes: 2 additions & 2 deletions bluepyemodel/emodel_pipeline/plotting.py
Original file line number Diff line number Diff line change
@@ -661,7 +661,7 @@ def _get_if_curve_from_evaluator(
stim_end = delay + length_step

efel.reset()
efel.setIntSetting("strict_stiminterval", True)
efel.set_int_setting("strict_stiminterval", True)

soma_loc = NrnSeclistCompLocation(name="soma", seclist_name="somatic", sec_index=0, comp_x=0.5)
rec = CompRecording(name="Step1.soma.v", location=soma_loc, variable="v")
@@ -699,7 +699,7 @@ def _get_if_curve_from_evaluator(
"stim_start": [delay],
"stim_end": [stim_end],
}
features = efel.getFeatureValues(
features = efel.get_feature_values(
[efel_trace], ["Spikecount", "mean_frequency"], raise_warnings=False
)[0]
spike_freq_equivalent.append(1e3 * float(features["Spikecount"]) / length_step)
18 changes: 9 additions & 9 deletions bluepyemodel/evaluation/efel_feature_bpem.py
Original file line number Diff line number Diff line change
@@ -162,28 +162,28 @@ def _setup_efel(self):
efel.reset()

if self.threshold is not None:
efel.setThreshold(self.threshold)
efel.set_threshold(self.threshold)

if self.stimulus_current is not None:
if callable(self.stimulus_current):
efel.setDoubleSetting("stimulus_current", self.stimulus_current())
efel.set_double_setting("stimulus_current", self.stimulus_current())
else:
efel.setDoubleSetting("stimulus_current", self.stimulus_current)
efel.set_double_setting("stimulus_current", self.stimulus_current)

if self.interp_step is not None:
efel.setDoubleSetting("interp_step", self.interp_step)
efel.set_double_setting("interp_step", self.interp_step)

if self.double_settings is not None:
for setting_name, setting_value in self.double_settings.items():
efel.setDoubleSetting(setting_name, setting_value)
efel.set_double_setting(setting_name, setting_value)

if self.int_settings is not None:
for setting_name, setting_value in self.int_settings.items():
efel.setIntSetting(setting_name, setting_value)
efel.set_int_setting(setting_name, setting_value)

if self.string_settings is not None:
for setting_name, setting_value in self.string_settings.items():
efel.setStrSetting(setting_name, setting_value)
efel.set_str_setting(setting_name, setting_value)

def calculate_feature(self, responses, raise_warnings=False):
"""Calculate feature value"""
@@ -200,7 +200,7 @@ def calculate_feature(self, responses, raise_warnings=False):
logger.debug("Amplitude for %s: %s", self.name, self.stimulus_current)
import efel

values = efel.getFeatureValues(
values = efel.get_feature_values(
[efel_trace], [self.efel_feature_name], raise_warnings=raise_warnings
)

@@ -409,7 +409,7 @@ def get_distances_feature_values(self, responses, raise_warnings=False):
self._setup_efel()
import efel

values = efel.getFeatureValues(
values = efel.get_feature_values(
efel_traces, [self.efel_feature_name], raise_warnings=raise_warnings
)
feature_values_ = [
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@
"bluepyopt>=1.14.10",
"bluepyefe>=2.2.0",
"neurom>=3.0,<4.0",
"efel>=3.1",
"efel>=5.5.5",
"configparser",
"neuron>=8.0",
"morph_tool>=2.8",