Skip to content

Commit 798ca9b

Browse files
committed
moved project to python 3.9 -> interpreter compatibility with cellstar
1 parent 2fdfc6e commit 798ca9b

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
lines changed

‎.idea/ciftools-python.iml‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/misc.xml‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎ciftools/binary/encoding/impl/encoders/string_array.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
fromtypingimportUnion
2+
13
importnumpyasnp
24
fromciftools.binary.encodingimportBinaryCIFEncoder
35
fromciftools.binary.encoding.base.cif_encoder_baseimportCIFEncoderBase
@@ -13,7 +15,7 @@
1315

1416

1517
classStringArrayCIFEncoder(CIFEncoderBase):
16-
defencode(self, data: np.ndarray|list[str]) ->EncodedCIFData:
18+
defencode(self, data: Union[np.ndarray, list[str]]) ->EncodedCIFData:
1719
_map=dict()
1820

1921
strings: list[str] = []

‎ciftools/tests/delta.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
importtimeit
12
importunittest
23

34
importmsgpack
@@ -13,6 +14,7 @@ def test(self):
1314
test_arr=np.array([1, 1, 2, 2, 10, -10])
1415

1516
encoder=BinaryCIFEncoder([DELTA_CIF_ENCODER, BYTE_ARRAY_CIF_ENCODER])
17+
1618
encoded=encoder.encode_cif_data(test_arr)
1719
msgpack.loads(msgpack.dumps(encoded))
1820
decoded=decode_cif_data(encoded)

‎ciftools/writer/base.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
importabc
2-
fromtypingimportAny
2+
fromtypingimportAny, Union
33

44
importnumpyasnp
55
fromciftools.binary.encoding.impl.binary_cif_encoderimportBinaryCIFEncoder
@@ -10,7 +10,7 @@ class FieldDesc(abc.ABC):
1010
name: str
1111

1212
@abc.abstractmethod
13-
defcreate_array(self, total_count: int) ->np.ndarray|list:
13+
defcreate_array(self, total_count: int) ->Union[np.ndarray, list]:
1414
pass
1515

1616
@abc.abstractmethod

‎ciftools/writer/fields.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fromtypingimportAny, Callable, Optional
1+
fromtypingimportAny, Callable, Optional, Union
22

33
importnumpyasnp
44
fromciftools.binary.encoding.impl.binary_cif_encoderimportBinaryCIFEncoder
@@ -60,7 +60,7 @@ def create_array(self, total_count: int):
6060
def__init__(
6161
self,
6262
name: str,
63-
value: Callable[[Any, int], Optional[int|float]],
63+
value: Callable[[Any, int], Optional[Union[int, float]]],
6464
dtype: np.dtype,
6565
encoder: Callable[[Any], BinaryCIFEncoder],
6666
presence: Optional[Callable[[Any, int], Optional[ValuePresenceEnum]]] =None,
@@ -75,7 +75,7 @@ def __init__(
7575
defnumber_field(
7676
*,
7777
name: str,
78-
value: Callable[[Any, int], Optional[int|float]],
78+
value: Callable[[Any, int], Optional[Union[int, float]]],
7979
dtype: np.dtype,
8080
encoder: Callable[[Any], BinaryCIFEncoder],
8181
presence: Optional[Callable[[Any, int], Optional[ValuePresenceEnum]]] =None,

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="CifTools",
5-
version="0.1.0",
5+
version="0.1.1",
66
url="https://github.com/molstar/ciftools-python",
77
author="Ravi Ramos",
88
author_email="[email protected]",

0 commit comments

Comments
(0)