Skip to content

Commit 57ab0f8

Browse files
committed
Stash loci imports into an internal submodule
1 parent 683b19e commit 57ab0f8

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

src/imcflibs/imagej/_loci.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""Internal wrapper module to import from the (Java) loci package.
2+
3+
This module mostly exists to work around the issue that importing the
4+
`ImporterOptions` class from the Java `loci` package requires syntax to be used
5+
that is considered invalid by any C-Python parser (but is still valid and
6+
working in Jython) and hence will break usage of Black, Pylint, and similar.
7+
8+
By stashing this into an internal submodule only checks on this specific
9+
(minimalistic) file will fail but remain operational for the other code.
10+
"""
11+
12+
from loci.plugins import BF
13+
14+
from loci.plugins.in import ImporterOptions # pdoc: skip
15+
16+
from loci.formats import ImageReader, Memoizer

src/imcflibs/imagej/bioformats.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
import os
1414

1515
from ij import IJ
16-
from loci.plugins import BF
1716

18-
from loci.plugins.in import ImporterOptions # pdoc: skip
19-
20-
from loci.formats import ImageReader, Memoizer
17+
from ._loci import BF, ImporterOptions, ImageReader, Memoizer
2118

2219
from ..pathtools import gen_name_from_orig
2320
from ..log import LOG as log

0 commit comments

Comments
 (0)