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

update C++ codebase for handling of feature dependencies [vcs: #minor] #334

Merged
merged 94 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
0e6dbcd
throw runtime_error, rm exit(1) in featuretype&calcfeatures
anilbey Oct 20, 2023
5cc3c5e
rename type->input_type
anilbey Oct 20, 2023
2a84582
throw EfelAssertionError to avoid exit(-1)
anilbey Oct 20, 2023
84626df
add test to trigger C++->Python AssertionError
anilbey Oct 20, 2023
954613a
remove featurename.find(";") check
anilbey Oct 20, 2023
e9cbcc8
typo in docstring
anilbey Oct 20, 2023
443e083
add feature's name to the error message
anilbey Oct 20, 2023
f11e36d
Revert "remove featurename.find(";") check"
anilbey Oct 20, 2023
108ca85
remove setversion function
anilbey Oct 20, 2023
71f687d
draft: removing alternative wildcard syntax
anilbey Oct 20, 2023
2ba460d
merge master
anilbey Oct 25, 2023
3748628
remove variable features in LibV5
anilbey Oct 25, 2023
9fa5fa4
remove variable (alias) features in LibV2
anilbey Nov 3, 2023
f07895b
simplify feature pointers representation in cppcore, remove wildcards
anilbey Nov 3, 2023
655cd03
make AddUniqueItem void
anilbey Nov 3, 2023
34cfb4d
remove empty function getDependencyList
anilbey Nov 3, 2023
b8f629a
directly check stream's state after opening the file
anilbey Nov 3, 2023
d91d476
remove dead code in efel and cfeature
anilbey Nov 3, 2023
9172cc7
merge efel into cppcore
anilbey Nov 3, 2023
8ed52a8
add template to getParam
anilbey Nov 6, 2023
786f636
add getFeatures fn to get all dependent features
anilbey Nov 6, 2023
6a80aeb
LibV5.cpp update until time_to_last_spike
anilbey Nov 6, 2023
cf52d1d
libv5 update ISI computations
anilbey Nov 6, 2023
1abfbac
LibV5 remove ISI first, second etc. duplication
anilbey Nov 6, 2023
32eb094
calculateInvISI throw except instead of return 0
anilbey Nov 6, 2023
13c21f6
use getFeatures in depolarized_base
anilbey Nov 6, 2023
9ad88fd
use getFeatures in steady_state_hyper
anilbey Nov 6, 2023
4de7876
depolarized_based consider retVal==0 failure
anilbey Nov 7, 2023
3c86f4e
use getFeatures in LibV2
anilbey Nov 7, 2023
4d36018
use getFeatures in LibV1
anilbey Nov 7, 2023
65e8f60
using to replace scope resolution
anilbey Nov 8, 2023
d0084a3
define distinct errors: FeatureComputationError, EmptyFeatureError
anilbey Nov 8, 2023
84b3020
use getFeature/s in LibV5 for consistent handling of edge cases
anilbey Nov 9, 2023
841f2b3
remove unnecessary initializer_list
anilbey Nov 14, 2023
ffd9d03
min_AHP_indices to use getFeatures
anilbey Nov 14, 2023
90a5dc6
AHP_depth_abs with getFeature
anilbey Nov 14, 2023
749e002
spike_half_width to use getFeatures
anilbey Nov 14, 2023
932b1b1
AP_begin_indices to use getFeatures
anilbey Nov 14, 2023
35a8450
use getFeatures in current_base
anilbey Nov 14, 2023
0510877
getfeatures in burst_begin_indices
anilbey Nov 14, 2023
378c278
decay_time_constant_after_stim to use getFeatures
anilbey Nov 15, 2023
8ded463
libv5 exception handling
anilbey Nov 15, 2023
a21b653
remove getVec completely
anilbey Nov 16, 2023
f3b3a73
Merge branch 'master' into wildcards
anilbey Nov 29, 2023
4e6514b
make format
anilbey Nov 29, 2023
f7425b8
Merge branch 'master' into wildcards
anilbey Dec 12, 2023
d1101d9
replace throw EmptyFeatureError with return -1 for consistency
anilbey Dec 14, 2023
a4335ec
Merge branch 'wildcards' of https://github.com/BlueBrain/eFEL into wi…
anilbey Dec 14, 2023
bde76af
remove redundant else condition
anilbey Dec 14, 2023
d6848c3
avoid fetching ignore_first_ISI twice
anilbey Dec 14, 2023
3ca2801
in the spikewidth2 error message mention spikewidth2
anilbey Dec 14, 2023
9b9d382
update maximum_voltage's success case to be same asminimum_voltages
anilbey Dec 14, 2023
d5d5ed7
make peakvoltage vector a reference in amp_drop_first_last
anilbey Dec 14, 2023
e7907c8
remove obsolete empty feature checks in spike_width1
anilbey Dec 14, 2023
e790e16
remove else after throw
anilbey Dec 14, 2023
f3adcc3
update new line in code comment for readability
anilbey Dec 14, 2023
83a57b1
replace GErrorStr+1 and return -1 via exception
anilbey Dec 14, 2023
444bfe7
add test to cover single spike case in min_voltage_between_spikes
anilbey Dec 14, 2023
5a5c22d
cover stimulus_current==0.0 edge case in ohmic resistance features
anilbey Dec 14, 2023
d7c576f
remove else after throw in 3 LibV5 places
anilbey Dec 14, 2023
944140a
typo in test name
anilbey Dec 15, 2023
b3a33f3
test_ohmic_input_resistance_zero_stimulus_current update stim params
anilbey Dec 15, 2023
1253dd3
update fail case for spikecount & spikecount_stimint
anilbey Dec 19, 2023
5784c06
add test calling all features on constant trace
anilbey Dec 19, 2023
c101450
remove re imported import in test
anilbey Dec 19, 2023
2ff86ed
merge master into wildcards
anilbey Dec 19, 2023
267220d
impute Spikecount missing val to 0.0 in GranuleCellDeap1.ipynb
anilbey Dec 19, 2023
9e9286f
remove unnecessary variable
anilbey Dec 21, 2023
241a2d7
move Spikecount implementation to Python
anilbey Dec 21, 2023
46007d2
change doc of Spikecount as Python efeature
anilbey Dec 21, 2023
818e3a1
move Spikecount_stimint to Python
anilbey Dec 21, 2023
f778c6a
add validation module with check_ais_initiation
anilbey Jan 4, 2024
eebc16e
add bpap_attenuation as a multitrace feature
anilbey Jan 4, 2024
31b7212
move burst_number and strict_burst_number to Python
anilbey Jan 5, 2024
4c1aae3
update impedance, remove spikecount is None check
anilbey Jan 5, 2024
d287792
add CHANGELOG.md
anilbey Jan 5, 2024
7a2594d
Merge branch 'master' into wildcards
anilbey Jan 5, 2024
133a48e
Merge branch 'master' into wildcards
anilbey Jan 8, 2024
cc4f705
docs: add multitrace and validation modules to API
anilbey Jan 8, 2024
c02f4c9
Merge branch 'master' into wildcards
anilbey Jan 8, 2024
df224bd
Docs: add name change warnings
anilbey Jan 8, 2024
c7ff80a
Merge branch 'wildcards' of github.com:BlueBrain/eFEL into wildcards
anilbey Jan 8, 2024
082f205
add int/double template instantiations to cfeature
anilbey Jan 9, 2024
c7a4cc9
remove getDistance_cpp, use python implementation
anilbey Jan 9, 2024
5f8881b
move trace_check to pyfeatures
anilbey Jan 9, 2024
b6940d1
lint fix
anilbey Jan 9, 2024
87cc375
add from __future__ import annotations
anilbey Jan 9, 2024
41b087e
add stimulus_current to test_allfeatures_on_constant_V
anilbey Jan 9, 2024
f39e7eb
allow both spike_count and Spikecount
anilbey Jan 9, 2024
489c247
move validation.py inside pyfeatures
anilbey Jan 9, 2024
c6033de
Revert "add stimulus_current to test_allfeatures_on_constant_V"
anilbey Jan 9, 2024
2682494
add spike_count expect it to be 0 for allfeatures_on_constant_voltage
anilbey Jan 9, 2024
43bf8b3
encourage use of spike_count instead of Spikecount
anilbey Jan 9, 2024
bc15caa
update deprecation note in the docs
anilbey Jan 10, 2024
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 docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Submodules
io
pyfeatures.multitrace
pyfeatures.pyfeatures
pyfeatures.validation
units
settings
validation
2 changes: 2 additions & 0 deletions efel/pyfeatures/pyfeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
'depol_block_bool',
'Spikecount',
'Spikecount_stimint',
'spike_count',
'spike_count_stimint',
'spikes_per_burst',
'spikes_per_burst_diff',
'spikes_in_burst1_burst2_diff',
Expand Down
File renamed without changes.
10 changes: 7 additions & 3 deletions tests/test_allfeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ def test_allfeatures():
"""allfeatures: Regression testing all features on a trace"""

feature_values = get_allfeature_values()

# drop spike_count and spike_count_stimint from feature values since they
# are the same as deprecated Spikecount and Spikecount_stimint
feature_values.pop('spike_count')
feature_values.pop('spike_count_stimint')
test_data_path = os.path.join(testdata_dir, 'expectedresults.json')
with open(test_data_path, 'r') as expected_json:
expected_results = json.load(expected_json)
Expand Down Expand Up @@ -182,8 +185,9 @@ def test_allfeatures_on_constant_voltage():
"steady_state_voltage", "steady_state_voltage_stimend",
"voltage_deflection", "voltage_deflection_begin", "voltage_deflection_vb_ssse",
"depol_block", "depol_block_bool", "voltage_base", "Spikecount",
"Spikecount_stimint", "burst_number", "strict_burst_number", "trace_check",
"ohmic_input_resistance", "ohmic_input_resistance_vb_ssse"
"Spikecount_stimint", "spike_count", "spike_count_stimint", "burst_number",
"strict_burst_number", "trace_check", "ohmic_input_resistance",
"ohmic_input_resistance_vb_ssse"
]

for field in array_fields:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,8 @@ def test_getFeatureNames():
test_data_path = testdata_dir.parent / 'featurenames.json'
with open(test_data_path, 'r') as featurenames_json:
expected_featurenames = json.load(featurenames_json)
# add the new names for the deprecated ones
expected_featurenames += ["spike_count", "spike_count_stimint"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The featurenames_json should reflect all the features that we have. If we don't want to duplicate spike_count, it would be better I think to have spike_count in the file, and add deprecated Spikecount in code here to legacy, instead of the inverse as we have now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok makes sense so renaming Spikecount -> spike_count in the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in the last push.

assert set(efel.getFeatureNames()) == set(expected_featurenames)


Expand Down
2 changes: 2 additions & 0 deletions tests/test_cppcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def test_getFeatureNames(self): # pylint: disable=R0201
test_data_path = os.path.join(testdata_dir, '../featurenames.json')
with open(test_data_path, 'r') as featurenames_json:
expected_featurenames = json.load(featurenames_json)
# add the new names for the deprecated ones
expected_featurenames += ["spike_count", "spike_count_stimint"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as comment above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in the latest push.

assert set(feature_names) == set(expected_featurenames)

def test_getFeatureDouble_failure(self): # pylint: disable=R0201
Expand Down
2 changes: 1 addition & 1 deletion tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import efel
from efel.io import load_ascii_input
from efel.validation import check_ais_initiation
from efel.pyfeatures.validation import check_ais_initiation


testdata_dir = Path(__file__).parent / "testdata"
Expand Down