-
Notifications
You must be signed in to change notification settings - Fork 38
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
fix AHP_slow_time and min_AHP_values #394
fix AHP_slow_time and min_AHP_values #394
Conversation
replace empty list features with None, following what is described here: Issue #321 |
if (vec.empty()) GErrorStr += "Feature [" + strName + "] data is missing\n"; | ||
if (vec.empty()) { | ||
GErrorStr += "Feature [" + strName + "] data is missing\n"; | ||
return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will turn empty lists into None
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #394 +/- ##
==========================================
+ Coverage 91.73% 91.78% +0.05%
==========================================
Files 36 37 +1
Lines 6278 7096 +818
Branches 2033 2276 +243
==========================================
+ Hits 5759 6513 +754
- Misses 266 304 +38
- Partials 253 279 +26 ☔ View full report in Codecov by Sentry. |
wouldn't be clearer to call the dependent feature by using |
How would we do that concretely? |
would something like this make sense? (for min_AHP_values)
|
Ok I see, it makes sense. I'll implement it, thanks |
@ilkilic done in latest commit! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic! Thank you!
Description
min_AHP_values
andAHP_slow_time
are a little bit special because they are computed during other features computation (min_AHP_indices
andAHP_depth_abs_slow
). So when we call them, the feature function does nothing, except calling the other feature with the dependency graph. The problem was that the 'empty' feature function still returns-1
, and that can be caught afterwards, and replace the feature values withNone
(depending on the order of the features passed to efel).This PR just replaces these
-1
with1
s. The feature is no longer replaced byNone
. In the case where the feature cannot be computed but still returns1
, this does not cause a problem, because whenpyfeatures.cppfeature_access.get_cpp_feature
will not find the feature, it will just replace it withNone
, as expected.Checklist: