pyetp 0.0.33__tar.gz → 0.0.34__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyetp-0.0.33 → pyetp-0.0.34}/PKG-INFO +3 -2
- {pyetp-0.0.33 → pyetp-0.0.34}/pyetp/client.py +21 -15
- {pyetp-0.0.33 → pyetp-0.0.34}/pyproject.toml +2 -2
- {pyetp-0.0.33 → pyetp-0.0.34}/LICENSE.md +0 -0
- {pyetp-0.0.33 → pyetp-0.0.34}/README.md +0 -0
- {pyetp-0.0.33 → pyetp-0.0.34}/pyetp/__init__.py +0 -0
- {pyetp-0.0.33 → pyetp-0.0.34}/pyetp/config.py +0 -0
- {pyetp-0.0.33 → pyetp-0.0.34}/pyetp/resqml_objects/__init__.py +0 -0
- {pyetp-0.0.33 → pyetp-0.0.34}/pyetp/resqml_objects/generated.py +0 -0
- {pyetp-0.0.33 → pyetp-0.0.34}/pyetp/types.py +0 -0
- {pyetp-0.0.33 → pyetp-0.0.34}/pyetp/uri.py +0 -0
- {pyetp-0.0.33 → pyetp-0.0.34}/pyetp/utils.py +0 -0
- {pyetp-0.0.33 → pyetp-0.0.34}/pyetp/utils_arrays.py +0 -0
- {pyetp-0.0.33 → pyetp-0.0.34}/pyetp/utils_xml.py +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pyetp
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.34
|
|
4
4
|
Summary: Interface with OSDU RDDMS using ETP protocol
|
|
5
5
|
Author: Adam Cheng
|
|
6
6
|
Author-email: 52572642+adamchengtkc@users.noreply.github.com
|
|
7
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.10,<3.13
|
|
8
8
|
Classifier: Development Status :: 3 - Alpha
|
|
9
9
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
14
|
Requires-Dist: async-lru (>=2.0.4,<3.0.0)
|
|
@@ -25,7 +25,7 @@ from pyetp.config import SETTINGS
|
|
|
25
25
|
from pyetp.types import *
|
|
26
26
|
from pyetp.uri import DataObjectURI, DataspaceURI
|
|
27
27
|
from pyetp.utils import short_id, batched
|
|
28
|
-
from asyncio import timeout
|
|
28
|
+
#from asyncio import timeout
|
|
29
29
|
|
|
30
30
|
try:
|
|
31
31
|
# for py >3.11, we can raise grouped exceptions
|
|
@@ -34,18 +34,18 @@ except ImportError:
|
|
|
34
34
|
def ExceptionGroup(msg, errors):
|
|
35
35
|
return errors[0]
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
try:
|
|
38
|
+
from asyncio import timeout
|
|
39
|
+
except ImportError:
|
|
40
|
+
import async_timeout
|
|
41
|
+
from contextlib import asynccontextmanager
|
|
42
|
+
@asynccontextmanager
|
|
43
|
+
async def timeout(delay: T.Optional[float]) -> T.Any:
|
|
44
|
+
try:
|
|
45
|
+
async with async_timeout.timeout(delay):
|
|
46
|
+
yield None
|
|
47
|
+
except asyncio.CancelledError as e:
|
|
48
|
+
raise asyncio.TimeoutError(f'Timeout ({delay}s)') from e
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
logger = logging.getLogger(__name__)
|
|
@@ -502,11 +502,15 @@ class ETPClient(ETPConnection):
|
|
|
502
502
|
)
|
|
503
503
|
async def start_transaction(self, dataspace_uri: DataspaceURI, readOnly :bool= True) -> uuid.UUID:
|
|
504
504
|
trans_id = await self.send(StartTransaction(readOnly=readOnly, dataspaceUris=[dataspace_uri.raw_uri]))
|
|
505
|
+
if trans_id.successful is False:
|
|
506
|
+
raise Exception(f"Failed starting transaction {dataspace_uri.raw_uri}")
|
|
505
507
|
return uuid.UUID(bytes=trans_id.transaction_uuid)
|
|
506
508
|
|
|
507
509
|
async def commit_transaction(self, transaction_id: uuid.UUID):
|
|
508
|
-
|
|
509
|
-
|
|
510
|
+
r = await self.send(CommitTransaction(transaction_uuid=transaction_id))
|
|
511
|
+
if r.successful is False:
|
|
512
|
+
raise Exception(r.failure_reason)
|
|
513
|
+
return r
|
|
510
514
|
|
|
511
515
|
async def rollback_transaction(self, transaction_id: uuid.UUID):
|
|
512
516
|
return await self.send(RollbackTransaction(transactionUuid=transaction_id))
|
|
@@ -1001,6 +1005,7 @@ class ETPClient(ETPConnection):
|
|
|
1001
1005
|
buffer[slices] = array
|
|
1002
1006
|
return
|
|
1003
1007
|
coro = [populate(starts, counts) for starts, counts in self._get_chunk_sizes(buffer_shape, dtype, offset)]
|
|
1008
|
+
logger.debug(f"Concurrent request: {self.max_concurrent_requests}")
|
|
1004
1009
|
for i in batched(coro, self.max_concurrent_requests):
|
|
1005
1010
|
await asyncio.gather(*i)
|
|
1006
1011
|
# r = await asyncio.gather(*[
|
|
@@ -1020,6 +1025,7 @@ class ETPClient(ETPConnection):
|
|
|
1020
1025
|
params.append([starts, counts])
|
|
1021
1026
|
#await self.put_subarray(uid, data, starts, counts)
|
|
1022
1027
|
coro.append(self.put_subarray(uid, data, starts, counts))
|
|
1028
|
+
logger.debug(f"Concurrent request: {self.max_concurrent_requests}")
|
|
1023
1029
|
for i in batched(coro, self.max_concurrent_requests):
|
|
1024
1030
|
await asyncio.gather(*i)
|
|
1025
1031
|
#r = await asyncio.gather(*coro)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pyetp"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.34"
|
|
4
4
|
description = "Interface with OSDU RDDMS using ETP protocol"
|
|
5
5
|
authors = ["Adam Cheng <52572642+adamchengtkc@users.noreply.github.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -12,7 +12,7 @@ classifiers = [
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
[tool.poetry.dependencies]
|
|
15
|
-
python = ">=3.
|
|
15
|
+
python = ">=3.10, <3.13"
|
|
16
16
|
numpy = "^1.26.3"
|
|
17
17
|
websockets = "^12.0"
|
|
18
18
|
lxml = ">=4.9.4, <6.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|