~graphite-dev/whisper/trunk

« back to all changes in this revision

Viewing changes to test_whisper.py

  • Committer: GitHub
  • Author(s): Dan Cech
  • Date: 2017-06-27 01:18:37 UTC
  • mfrom: (141.2.5)
  • Revision ID: git-v1:0360c0d7e0ce964ae690356ccdf00bd4ff261fd3
Merge pull request #76 from yadsirhc/master

Adds new absmax aggregation method

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
        non_null = [i for i in avg_zero if i is not None]
218
218
        self.assertEqual(whisper.aggregate('avg_zero', non_null, avg_zero), 1.25)
219
219
        # avg_zero without neighborValues
220
 
 
221
220
        with self.assertRaises(whisper.InvalidAggregationMethod):
222
221
            whisper.aggregate('avg_zero', non_null)
 
222
        # absmax with negative max
 
223
        self.assertEqual(whisper.aggregate('absmax', [-3, -2, 1, 2]), -3)
 
224
        # absmax with positive max
 
225
        self.assertEqual(whisper.aggregate('absmax', [-2, -1, 2, 3]), 3)
 
226
        # absmin with positive min
 
227
        self.assertEqual(whisper.aggregate('absmin', [-3, -2, 1, 2]), 1)
 
228
        # absmin with negative min
 
229
        self.assertEqual(whisper.aggregate('absmin', [-2, -1, 2, 3]), -1)
223
230
 
224
231
        with AssertRaisesException(
225
232
                whisper.InvalidAggregationMethod(