-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fixing saturation indicator bug #123
Conversation
…alse error-calculation resulting in returning nan-values in the result of the mapping saturation index instead of choosing another calculation parameter
Change to prevent the bug at the moment: Instead of checking a single parameter for nan-values, check all values within the 4 parameters for nan-values and use else-clause if nan-values do exist |
Is
with |
no, but you need to check 2 lists and 2 floats which are all written in one tuple. therefore you need to handle the first to elements differently than the last two. and you need to check the results for each element within the nested list as well as the other float elements in the tuple |
so you could replace this: is this prefered? |
I meant something like this, it's just a little bit shorter and you don't have to use that much nesting layers ;) validity_result = all(map(math.isfinite, [*inits5curves[0] *inits5curves[1], inits5curves[2], inits5curves[3]])) |
Okay, thank you! Didn't knew you could use the * like that... implemented it! |
workers/ohsome_quality_analyst/indicators/mapping_saturation/sigmoid_curve.py
Show resolved
Hide resolved
workers/tests/integrationtests/test_indicator_mapping_saturation.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Matthias Schaub <83658582+matthiasschaub@users.noreply.github.com>
Prevent the mapping saturation indicator from returning nan-Values as result if data is available. See Issue #45 for bug description
Corresponding issue
Closes #45
New or changed dependencies
Checklist
main
(e.g. throughgit rebase main
)