Commit 4b5ad2a7 authored by Jérome Perrin's avatar Jérome Perrin

hack: integreate float equivalence tester patch

parent 1ce9a29b
...@@ -94,6 +94,13 @@ class FloatEquivalenceTester(Predicate, EquivalenceTesterMixin): ...@@ -94,6 +94,13 @@ class FloatEquivalenceTester(Predicate, EquivalenceTesterMixin):
# How to know if the other value is negligible or not ? # How to know if the other value is negligible or not ?
epsilon = abs(prevision_value * DEFAULT_PRECISION) epsilon = abs(prevision_value * DEFAULT_PRECISION)
if decision_value == 0.0:
# A delivery quantity of 0 is an exceptional case that we cannot really
# handle with the current approach of delivery ratio.
decision_value = sum([m.getCorrectedQuantity() for m in
decision_movement.getDeliveryRelatedValueList(
portal_type='Simulation Movement')])
delta = abs(decision_value - prevision_value) delta = abs(decision_value - prevision_value)
# XXX we should use appropriate property sheets and getter methods # XXX we should use appropriate property sheets and getter methods
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment