diff --git a/sumpy/p2p.py b/sumpy/p2p.py index 7e012497681a050cd607650f22efdcfcb0c5b529..a0e89f242f958bbaea411090582e885d942b2a1d 100644 --- a/sumpy/p2p.py +++ b/sumpy/p2p.py @@ -381,8 +381,8 @@ class P2PMatrixBlockGenerator(P2PBase): :arg targets: target point coordinates. :arg sources: source point coordinates. - :arg index_set: a :class:`sumpy.tools.MatrixBlockIndex` object used - to define the various blocks. + :arg index_set: a :class:`sumpy.tools.MatrixBlockIndexRanges` used + to define the blocks. :return: a tuple of one-dimensional arrays of kernel evaluations at target-source pairs described by `index_set`. """ diff --git a/sumpy/qbx.py b/sumpy/qbx.py index dea09e742fa6f38d1bb085392b04b8b292f9e499..a0814e01c412727a908ec72758e62014b3278708 100644 --- a/sumpy/qbx.py +++ b/sumpy/qbx.py @@ -400,10 +400,10 @@ class LayerPotentialMatrixBlockGenerator(LayerPotentialBase): :arg sources: source point coordinates. :arg centers: QBX target expansion centers. :arg expansion_radii: radii for each expansion center. - :arg index_set: a :class:`sumpy.tools.MatrixBlockIndex` object used - to define the various blocks. + :arg index_set: a :class:`sumpy.tools.MatrixBlockIndexRanges` used + to define the blocks. :return: a tuple of one-dimensional arrays of kernel evaluations at - target-source pairs described by `index_set`. + target-source pairs described by `index_set`. """ knl = self.get_cached_optimized_kernel() diff --git a/sumpy/tools.py b/sumpy/tools.py index 4a5ab86a6c3b0c4bd64a3892e9512f63f15d8883..469cb5e15238299092d55841f2bf43486bd11e0c 100644 --- a/sumpy/tools.py +++ b/sumpy/tools.py @@ -365,7 +365,7 @@ class BlockIndexRanges(object): return x[self.block_indices(i)] -class MatrixBlockIndex(object): +class MatrixBlockIndexRanges(object): """Keep track of different ways to index into matrix blocks. .. attribute:: row @@ -432,7 +432,7 @@ class MatrixBlockIndex(object): all :class:`pyopencl.array.Array` instances are replaces by :class:`numpy.ndarray` instances. """ - return MatrixBlockIndex(self.cl_context, + return MatrixBlockIndexRanges(self.cl_context, row=self.row.get(queue=queue), col=self.col.get(queue=queue)) @@ -447,7 +447,7 @@ class MatrixBlockIndex(object): if isinstance(self.row.indices, cl.array.Array) or \ isinstance(self.col.indices, cl.array.Array): raise ValueError("CL `Array`s are not supported." - "Use MatrixBlockIndex.get() and then view into matrices.") + "Use MatrixBlockIndexRanges.get() and then view into matrices.") irow, icol = self.block_indices(i) return x[np.ix_(irow, icol)] diff --git a/test/test_matrixgen.py b/test/test_matrixgen.py index e11b6693fee5d3dbede763ceaab2c04e5e1da28a..2f3aabc3082b99707ab86b5461390e866350fdc3 100644 --- a/test/test_matrixgen.py +++ b/test/test_matrixgen.py @@ -30,7 +30,7 @@ import pyopencl as cl import pyopencl.array # noqa from sumpy.tools import vector_to_device -from sumpy.tools import MatrixBlockIndex +from sumpy.tools import MatrixBlockIndexRanges import pytest from pyopencl.tools import ( # noqa @@ -139,7 +139,7 @@ def test_qbx_direct(ctx_getter, factor, lpot_id): tgtindices = _build_block_index(queue, n, nblks, factor) srcindices = _build_block_index(queue, n, nblks, factor) - index_set = MatrixBlockIndex(ctx, tgtindices, srcindices) + index_set = MatrixBlockIndexRanges(ctx, tgtindices, srcindices) extra_kwargs = {} if lpot_id == 2: @@ -211,7 +211,7 @@ def test_p2p_direct(ctx_getter, exclude_self, factor): tgtindices = _build_block_index(queue, n, nblks, factor) srcindices = _build_block_index(queue, n, nblks, factor) - index_set = MatrixBlockIndex(ctx, tgtindices, srcindices) + index_set = MatrixBlockIndexRanges(ctx, tgtindices, srcindices) extra_kwargs = {} if exclude_self: