Skip to content

Commit 1b47291

Browse files
committed
Make the linter happy
1 parent 33c4ea1 commit 1b47291

4 files changed

Lines changed: 26 additions & 37 deletions

File tree

src/scyjava/__init__.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@
7070
from functools import lru_cache
7171
from typing import Any, Callable, Dict
7272

73-
from ._arrays import ( # noqa: F401
74-
is_arraylike,
75-
is_memoryarraylike,
76-
is_xarraylike,
77-
)
73+
from ._arrays import is_arraylike, is_memoryarraylike, is_xarraylike # noqa: F401
7874
from ._convert import ( # noqa: F401
7975
Converter,
8076
JavaCollection,
@@ -121,11 +117,7 @@
121117
jstacktrace,
122118
numeric_bounds,
123119
)
124-
from ._versions import ( # noqa: F401
125-
compare_version,
126-
get_version,
127-
is_version_at_least,
128-
)
120+
from ._versions import compare_version, get_version, is_version_at_least # noqa: F401
129121

130122
__version__ = get_version("scyjava")
131123
__all__ = [

src/scyjava/_convert.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,8 @@
1212

1313
from jpype import JBoolean, JByte, JChar, JDouble, JFloat, JInt, JLong, JShort
1414

15-
from scyjava._jvm import (
16-
jimport,
17-
start_jvm,
18-
)
19-
from scyjava._types import (
20-
JavaClasses,
21-
is_jarray,
22-
isjava,
23-
jarray,
24-
jclass,
25-
jinstance,
26-
)
15+
from scyjava._jvm import jimport, start_jvm
16+
from scyjava._types import JavaClasses, is_jarray, isjava, jarray, jclass, jinstance
2717
from scyjava.config import Mode, mode
2818

2919
_logger = logging.getLogger(__name__)

src/scyjava/_types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Utility functions for working with and reasoning about Java types.
33
"""
4-
from typing import Union, Tuple, Callable, Sequence, Any
4+
from typing import Any, Callable, Sequence, Tuple, Union
55

66
import jpype
77

@@ -280,7 +280,9 @@ def jarray(kind, lengths: Sequence):
280280
return arr
281281

282282

283-
def numeric_bounds(the_type: type) -> Union[Tuple[int, int], Tuple[float, float], Tuple[None, None]]:
283+
def numeric_bounds(
284+
the_type: type,
285+
) -> Union[Tuple[int, int], Tuple[float, float], Tuple[None, None]]:
284286
"""
285287
Get the minimum and maximum values for the given numeric type.
286288
For example, a Java long returns (int(Long.MIN_VALUE), int(Long.MAX_VALUE)),

tests/test_types.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import scyjava
2-
from scyjava import to_java, numeric_bounds
1+
from scyjava import numeric_bounds, to_java
32

43

54
class TestTypes(object):
@@ -8,20 +7,26 @@ class TestTypes(object):
87
"""
98

109
def test_numeric_bounds(self):
11-
v_byte = to_java(1, type='byte')
12-
v_short = to_java(2, type='short')
13-
v_int = to_java(3, type='int')
14-
v_long = to_java(4, type='long')
15-
v_bigint = to_java(5, type='bigint')
16-
v_float = to_java(6.7, type='float')
17-
v_double = to_java(7.8, type='double')
18-
v_bigdec = to_java(8.9, type='bigdec')
10+
v_byte = to_java(1, type="byte")
11+
v_short = to_java(2, type="short")
12+
v_int = to_java(3, type="int")
13+
v_long = to_java(4, type="long")
14+
v_bigint = to_java(5, type="bigint")
15+
v_float = to_java(6.7, type="float")
16+
v_double = to_java(7.8, type="double")
17+
v_bigdec = to_java(8.9, type="bigdec")
1918

2019
assert (-128, 127) == numeric_bounds(type(v_byte))
2120
assert (-32768, 32767) == numeric_bounds(type(v_short))
2221
assert (-2147483648, 2147483647) == numeric_bounds(type(v_int))
23-
assert (-9223372036854775808, 9223372036854775807) == numeric_bounds(type(v_long))
22+
assert (-9223372036854775808, 9223372036854775807) == numeric_bounds(
23+
type(v_long)
24+
)
2425
assert (None, None) == numeric_bounds(type(v_bigint))
25-
assert (-3.4028234663852886e+38, 3.4028234663852886e+38) == numeric_bounds(type(v_float))
26-
assert (-1.7976931348623157e+308, 1.7976931348623157e+308) == numeric_bounds(type(v_double))
26+
assert (-3.4028234663852886e38, 3.4028234663852886e38) == numeric_bounds(
27+
type(v_float)
28+
)
29+
assert (-1.7976931348623157e308, 1.7976931348623157e308) == numeric_bounds(
30+
type(v_double)
31+
)
2732
assert (None, None) == numeric_bounds(type(v_bigdec))

0 commit comments

Comments
 (0)