Skip to content

Commit

Permalink
Use JPype's @ operator to create Java arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
elevans committed Jan 29, 2024
1 parent c43c0fc commit fe46c6d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_image_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
import scyjava as sj
import xarray as xr
from jpype import JArray, JLong
from jpype import JLong

import imagej.convert as convert
import imagej.dims as dims
Expand Down Expand Up @@ -379,8 +379,7 @@ def test_dataset_converts_to_xarray(ij_fixture):

def test_bittype_img_to_ndarray(ij_fixture):
ArrayImgs = sj.jimport("net.imglib2.img.array.ArrayImgs")
dims = JArray(JLong)(3)
dims[:] = [10, 10, 10]
dims = JLong[:] @ [10, 10, 10]
j_img = ArrayImgs.bits(dims)
p_img = ij_fixture.py.from_java(j_img)
assert p_img.dtype == np.bool_
Expand Down

0 comments on commit fe46c6d

Please sign in to comment.