(
i,
roi_start,
rel_roi_start,
roi_end,
rel_roi_end,
roi_shape,
rel_roi_shape,
roi_axes,
out_of_bounds_policy,
fortran_order,
device,
fill_value,
)
| 755 | |
| 756 | @params(*list(_get_roi_suite_params())) |
| 757 | def test_numpy_reader_roi( |
| 758 | i, |
| 759 | roi_start, |
| 760 | rel_roi_start, |
| 761 | roi_end, |
| 762 | rel_roi_end, |
| 763 | roi_shape, |
| 764 | rel_roi_shape, |
| 765 | roi_axes, |
| 766 | out_of_bounds_policy, |
| 767 | fortran_order, |
| 768 | device, |
| 769 | fill_value, |
| 770 | ): |
| 771 | # setup file |
| 772 | shapes = [(10, 10), (12, 10), (10, 12), (20, 15), (10, 11), (12, 11), (13, 11), (19, 10)] |
| 773 | ndim = 2 |
| 774 | dtype = np.uint8 |
| 775 | batch_size = 8 |
| 776 | file_filter = "*.npy" |
| 777 | rng = np.random.default_rng(4242 + i) |
| 778 | |
| 779 | with tempfile.TemporaryDirectory(prefix=gds_data_root) as test_data_root: |
| 780 | index = 0 |
| 781 | for sh in shapes: |
| 782 | filename = os.path.join(test_data_root, "test_{:02d}.npy".format(index)) |
| 783 | index += 1 |
| 784 | if fortran_order is not None: |
| 785 | actual_fortran_order = fortran_order |
| 786 | else: |
| 787 | actual_fortran_order = rng.choice([False, True]) |
| 788 | create_numpy_file(filename, sh, dtype, actual_fortran_order) |
| 789 | |
| 790 | _testimpl_numpy_reader_roi( |
| 791 | test_data_root, |
| 792 | batch_size, |
| 793 | ndim, |
| 794 | dtype, |
| 795 | device, |
| 796 | fortran_order, |
| 797 | file_filter, |
| 798 | roi_start, |
| 799 | rel_roi_start, |
| 800 | roi_end, |
| 801 | rel_roi_end, |
| 802 | roi_shape, |
| 803 | rel_roi_shape, |
| 804 | roi_axes, |
| 805 | out_of_bounds_policy, |
| 806 | fill_value, |
| 807 | ) |
| 808 | |
| 809 | |
| 810 | def _get_roi_empty_axes_params(): |
nothing calls this directly
no test coverage detected