[change] Quality class determination documentation improvement

Also change order of expected/actual values in test assert methods to improve output of test function.
The first parameter is supposed to be the expected value, the second one the actual result.
This commit is contained in:
Darius Arnold
2018-08-07 13:58:59 +02:00
parent 677d3a200c
commit 146da1d794
2 changed files with 17 additions and 10 deletions

View File

@@ -1288,6 +1288,7 @@ def get_quality_class(uncertainty, weight_classes):
quality = next(i for i, v in enumerate(weight_classes) if v >= uncertainty)
except StopIteration:
# raised when uncertainty is larger than all values in weight_classes
# set quality to max possible value
quality = len(weight_classes)
return quality