|
22 | 22 | get_integer_float_dtypes, |
23 | 23 | has_support_aspect64, |
24 | 24 | numpy_version, |
| 25 | + requires_memory, |
25 | 26 | ) |
26 | 27 |
|
| 28 | +# Build a list of bin sizes to check the histogram |
| 29 | +_bin_counts = [10, 10**2, 10**3, 10**4, 10**5] |
| 30 | +if requires_memory(12): |
| 31 | + _bin_counts += [10**6] |
| 32 | + |
27 | 33 |
|
28 | 34 | class TestDigitize: |
29 | 35 | @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) |
@@ -486,10 +492,7 @@ def test_weights_another_sycl_queue(self): |
486 | 492 | with assert_raises(ValueError): |
487 | 493 | dpnp.histogram(v, weights=w) |
488 | 494 |
|
489 | | - @pytest.mark.parametrize( |
490 | | - "bins_count", |
491 | | - [10, 10**2, 10**3, 10**4, 10**5, 10**6], |
492 | | - ) |
| 495 | + @pytest.mark.parametrize("bins_count", _bin_counts) |
493 | 496 | def test_different_bins_amount(self, bins_count): |
494 | 497 | v = numpy.linspace(0, bins_count, bins_count, dtype=numpy.float32) |
495 | 498 | iv = dpnp.array(v) |
@@ -584,10 +587,7 @@ def test_weights_unsupported_dtype(self, xp, dt): |
584 | 587 | w = xp.arange(5, dtype=dt) |
585 | 588 | assert_raises((TypeError, ValueError), xp.bincount, v, weights=w) |
586 | 589 |
|
587 | | - @pytest.mark.parametrize( |
588 | | - "bins_count", |
589 | | - [10, 10**2, 10**3, 10**4, 10**5, 10**6], |
590 | | - ) |
| 590 | + @pytest.mark.parametrize("bins_count", _bin_counts) |
591 | 591 | def test_different_bins_amount(self, bins_count): |
592 | 592 | v = numpy.arange(0, bins_count, dtype=int) |
593 | 593 | iv = dpnp.array(v) |
@@ -863,10 +863,7 @@ def test_weights_another_sycl_queue(self): |
863 | 863 | with assert_raises(ValueError): |
864 | 864 | dpnp.histogramdd(v, weights=w) |
865 | 865 |
|
866 | | - @pytest.mark.parametrize( |
867 | | - "bins_count", |
868 | | - [10, 10**2, 10**3, 10**4, 10**5, 10**6], |
869 | | - ) |
| 866 | + @pytest.mark.parametrize("bins_count", _bin_counts) |
870 | 867 | def test_different_bins_amount(self, bins_count): |
871 | 868 | v = numpy.linspace(0, bins_count, bins_count, dtype=numpy.float32) |
872 | 869 | iv = dpnp.array(v) |
|
0 commit comments