Skip to content

Commit

Permalink
relaxing numpy version requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
brimoor committed Jul 12, 2022
1 parent 28434f5 commit 2de8c7a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/unittests/aggregation_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,20 @@ def test_quantiles(self):
q = np.linspace(0, 1, 11)

results1 = d.quantiles("numeric_field", q)
results2 = np.quantile([1, 2], q, method="inverted_cdf")

# only available in `numpy>=1.22`
# results2 = np.quantile([1, 2], q, method="inverted_cdf")
results2 = [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2]

self.assertEqual(len(results1), len(results2))
for r1, r2 in zip(results1, results2):
self.assertAlmostEqual(r1, r2)

results1 = d.quantiles(2.0 * (F("numeric_field") + 1), q)
results2 = np.quantile([4, 6], q, method="inverted_cdf")

# only available in `numpy>=1.22`
# results2 = np.quantile([4, 6], q, method="inverted_cdf")
results2 = [4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6]

self.assertEqual(len(results1), len(results2))
for r1, r2 in zip(results1, results2):
Expand Down

0 comments on commit 2de8c7a

Please sign in to comment.