Skip to content

Commit

Permalink
Coverage improvements (#674)
Browse files Browse the repository at this point in the history
* Remove unused code

* test_measure_reserved_mem does run on 'processes' executor
  • Loading branch information
tomwhite authored Jan 17, 2025
1 parent e7cf014 commit 2ad6569
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
18 changes: 0 additions & 18 deletions cubed/core/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,24 +713,6 @@ def _assemble_index_chunk(
return out


def _read_index_chunk(
x,
*arrays,
target_chunks=None,
selection=None,
block_id=None,
):
array = arrays[0].zarray
idx = block_id
# Note that since we only have a maximum of one integer array index
# we don't need to use Zarr orthogonal indexing, since it is
# "available directly on the array" according to
# https://zarr.readthedocs.io/en/stable/tutorial.html#orthogonal-indexing
out = array[_target_chunk_selection(target_chunks, idx, selection)]
out = numpy_array_to_backend_array(out)
return out


def _target_chunk_selection(target_chunks, idx, selection):
# integer, integer array, and slice indexes can be interspersed in selection
# idx is the chunk index for the output (target_chunks)
Expand Down
4 changes: 1 addition & 3 deletions cubed/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,7 @@ def test_array_pickle(spec, executor):

@pytest.mark.skipif(platform.system() == "Windows", reason="does not run on windows")
def test_measure_reserved_mem(executor):
pytest.importorskip("lithops")

if executor.name != "lithops":
if executor.name not in ("processes", "lithops"):
pytest.skip(f"{executor.name} executor does not support measure_reserved_mem")

reserved_memory = cubed.measure_reserved_mem(executor=executor)
Expand Down

0 comments on commit 2ad6569

Please sign in to comment.