shawnbrown / datatest

Tools for test driven data-wrangling and data validation.
Other
294 stars 13 forks source link

Add "notch filter" capability to deviation allowances. #16

Closed shawnbrown closed 8 years ago

shawnbrown commented 8 years ago

Currently, the deviation allowances (allowDeviation and allowPercentDeviation) can only be set to ranges around zero (asserts lower <= 0 <= upper). This should be changed to allow deviations from a given range even when the entire range is above or below zero.

The lower and upper arguments should also work when set to the exact same number:

with self.allowPercentDeviation(lower=-1.0, upper=-1.0):  # Allows only 100% 
    self.assertSubjectSum('C', ['A', 'B'])                # deviations but no
                                                          # others.
shawnbrown commented 8 years ago

This is done: 81172d26273061c0f539b7861a2e662124c84e1a