Skip to content

Commit

Permalink
Merge pull request #18 from fmi-faim/scyjava
Browse files Browse the repository at this point in the history
Replace deprecated bioformats_jar dependency
  • Loading branch information
BrianWhitneyAI authored Jan 22, 2025
2 parents c3f78ad + f4b5065 commit 9727260
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bioio_bioformats/tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
(1, 3, 1, 1024, 1024),
np.uint16,
dimensions.DEFAULT_DIMENSION_ORDER,
["Channel:0:0", "Channel:0:1", "Channel:0:2"],
["Red", "Green", "Blue"],
(0.001, 1.2059374999999999, 1.2059570312500014),
),
(
Expand Down
10 changes: 5 additions & 5 deletions bioio_bioformats/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

import jpype
import numpy as np
from bioformats_jar import get_loci
import scyjava
from bioio_base import dimensions, types
from jgo.jgo import ExecutableNotFound
from ome_types import OME

###############################################################################
Expand Down Expand Up @@ -662,8 +661,9 @@ def _hide_memoization_warning() -> None:

def _try_get_loci() -> jpype.JPackage:
try:
return get_loci()
except ExecutableNotFound as e:
raise RuntimeError(MAVEN_ERROR_MSG) from e
scyjava.config.endpoints.append("ome:formats-gpl:6.7.0")
scyjava.start_jvm()
loci = jpype.JPackage("loci")
return loci
except jpype.JVMNotFoundException as e:
raise RuntimeError(JAVA_ERROR_MSG) from e
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ classifiers = [
dynamic = ["version"]
dependencies = [
"bioio-base>=0.3.0",
"bioformats_jar",
"dask[array]>=2021.4.1",
"fsspec>=2022.8.0",
"numpy>=1.21",
"ome-types>=0.3.4",
"resource-backed-dask-array>=0.1.0",
"scyjava",
]

[project.urls]
Expand Down Expand Up @@ -110,7 +110,7 @@ show_error_codes = true
# https://gitlab.com/durko/flake8-pyprojecttoml
[tool.flake8]
max-line-length = 88
ignore = "E203,E402,W291,W503"
ignore = "E203,E231,E402,W291,W503"
min-python-version = "3.9.0"
per-file-ignores = [
"__init__.py:F401",
Expand Down

0 comments on commit 9727260

Please sign in to comment.