{"id":27715,"library":"efel","title":"eFEL (Electrophys Feature Extract Library)","description":"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.","status":"active","version":"5.7.23","language":"python","source_language":"en","source_url":"https://github.com/openbraininstitute/eFEL","tags":["neuroscience","electrophysiology","feature extraction","action potential","spike detection"],"install":[{"cmd":"pip install efel","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"note":"getFeatureValues is called as efel.getFeatureValues() after importing the module, not a direct import.","wrong":"from efel import getFeatureValues","symbol":"getFeatureValues","correct":"import efel"},{"note":"","wrong":"","symbol":"setThreshold","correct":"import efel"},{"note":"","wrong":"","symbol":"reset","correct":"import efel"}],"quickstart":{"code":"import efel\nimport numpy as np\n\n# Generate a simple synthetic action potential trace\ntime = np.arange(0, 10, 0.1)  # 10 seconds, step 0.1 ms\nvoltage = np.zeros(len(time))\nvoltage[50:60] = 20  # simple spike\n\ntrace = {'T': time, 'V': voltage, 'stim_start': [100.0], 'stim_end': [900.0]}\n\n# Set threshold\nimport efel\nefel.setThreshold(-10)\n\n# Calculate features\nfeatures = efel.getFeatureValues([trace], ['Spikecount', 'AP_amplitude'])\nprint(features[0]['Spikecount'])\nprint(features[0]['AP_amplitude'])","lang":"python","description":"Basic usage: create a trace dict with T, V, stim_start, stim_end, then call getFeatureValues."},"warnings":[{"fix":"Use Python 3.10 or higher.","message":"eFEL v5.0+ requires Python >=3.10. v4.x used Python 3.6+. Upgrade your Python environment.","severity":"breaking","affected_versions":">=5.0"},{"fix":"Always index the list: results = efel.getFeatureValues(traces, features); print(results[0]['feature_name']).","message":"The function 'getFeatureValues' returns a list of dicts, not a single dict. Access results via index, e.g., results[0]['Spikecount'].","severity":"breaking","affected_versions":"all"},{"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])}.","message":"Trace dictionaries must contain keys 'T', 'V', 'stim_start', 'stim_end' as numpy arrays. Using lists or missing keys will cause silent errors or KeyError.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace 'from efel.api import ...' with 'import efel' and call efel.getFeatureValues(), efel.setThreshold(), etc.","message":"The older API using efel.api is deprecated. Use the top-level module functions directly.","severity":"deprecated","affected_versions":">=5.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Ensure trace dict has all required keys: 'T', 'V', 'stim_start', 'stim_end' with numpy array values of consistent size.","cause":"Trace dictionary missing required key 'T' or value is not a numpy array with length matching 'V'.","error":"KeyError: 'T'"},{"fix":"Check that T and V arrays have the same length. For example: assert len(trace['T']) == len(trace['V']).","cause":"Mismatched lengths of 'T' and 'V' arrays in the trace dictionary.","error":"ValueError: voltage and time arrays must have the same length"},{"fix":"Run 'pip install efel' in the correct Python environment. Ensure Python >=3.10.","cause":"eFEL not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'efel'"},{"fix":"Verify import: 'import efel'. Use 'efel.getFeatureValues' (case-sensitive) and upgrade to latest: 'pip install --upgrade efel'.","cause":"Importing the module but using an incorrect attribute name (e.g., typo) or using an old version.","error":"AttributeError: module 'efel' has no attribute 'getFeatureValues'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}