Registry / ai-ml / efel
library5.7.23pypypi✓ verified 89d ago

eFEL is a Python library for extracting electrophysiological features from recorded or simulated voltage traces, used widely in neuroscience. Current version: 5.7.23. Release cadence: frequent patches, minor releases every few months.

pip install efel
INSTALL
IMPORT
SIG · EFEL
E
efel
ai-mlpythonv5.7.23
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

getFeatureValues
✓ import efel
✗ from efel import getFeatureValues
getFeatureValues is called as efel.getFeatureValues() after importing the module, not a direct import.
setThreshold
✓ import efel
reset
✓ import efel

Basic usage: create a trace dict with T, V, stim_start, stim_end, then call getFeatureValues.

import efel import numpy as np # Generate a simple synthetic action potential trace time = np.arange(0, 10, 0.1) # 10 seconds, step 0.1 ms voltage = np.zeros(len(time)) voltage[50:60] = 20 # simple spike trace = {'T': time, 'V': voltage, 'stim_start': [100.0], 'stim_end': [900.0]} # Set threshold import efel efel.setThreshold(-10) # Calculate features features = efel.getFeatureValues([trace], ['Spikecount', 'AP_amplitude']) print(features[0]['Spikecount']) print(features[0]['AP_amplitude'])
Debug
Known issues
breakingeFEL v5.0+ requires Python >=3.10. v4.x used Python 3.6+. Upgrade your Python environment.
fix
Use Python 3.10 or higher.
affects: >=5.0
breakingThe function 'getFeatureValues' returns a list of dicts, not a single dict. Access results via index, e.g., results[0]['Spikecount'].
fix
Always index the list: results = efel.getFeatureValues(traces, features); print(results[0]['feature_name']).
affects: all
gotchaTrace dictionaries must contain keys 'T', 'V', 'stim_start', 'stim_end' as numpy arrays. Using lists or missing keys will cause silent errors or KeyError.
fix
Ensure trace dict values are numpy arrays: trace = {'T': np.array(time), 'V': np.array(voltage), 'stim_start': np.array([100.0]), 'stim_end': np.array([900.0])}.
affects: all
deprecatedThe older API using efel.api is deprecated. Use the top-level module functions directly.
fix
Replace 'from efel.api import ...' with 'import efel' and call efel.getFeatureValues(), efel.setThreshold(), etc.
affects: >=5.0
Errors
Common errors & fixes
KeyError: 'T'
Trace dictionary missing required key 'T' or value is not a numpy array with length matching 'V'.
fix
Ensure trace dict has all required keys: 'T', 'V', 'stim_start', 'stim_end' with numpy array values of consistent size.
ValueError: voltage and time arrays must have the same length
Mismatched lengths of 'T' and 'V' arrays in the trace dictionary.
fix
Check that T and V arrays have the same length. For example: assert len(trace['T']) == len(trace['V']).
ModuleNotFoundError: No module named 'efel'
eFEL not installed or installed in a different environment.
fix
Run 'pip install efel' in the correct Python environment. Ensure Python >=3.10.
AttributeError: module 'efel' has no attribute 'getFeatureValues'
Importing the module but using an incorrect attribute name (e.g., typo) or using an old version.
fix
Verify import: 'import efel'. Use 'efel.getFeatureValues' (case-sensitive) and upgrade to latest: 'pip install --upgrade efel'.
Upgrade
Version history
5.7.23latest on PyPI · released Apr 17, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources