pyetp 0.0.45__py3-none-any.whl → 0.0.47__py3-none-any.whl

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.
Files changed (35) hide show
  1. energistics/__init__.py +0 -0
  2. energistics/etp/__init__.py +0 -0
  3. energistics/etp/v12/__init__.py +0 -0
  4. energistics/etp/v12/datatypes/__init__.py +25 -0
  5. energistics/etp/v12/datatypes/data_array_types/__init__.py +27 -0
  6. energistics/etp/v12/datatypes/object/__init__.py +22 -0
  7. energistics/etp/v12/protocol/__init__.py +0 -0
  8. energistics/etp/v12/protocol/core/__init__.py +19 -0
  9. energistics/etp/v12/protocol/data_array/__init__.py +51 -0
  10. energistics/etp/v12/protocol/dataspace/__init__.py +23 -0
  11. energistics/etp/v12/protocol/discovery/__init__.py +21 -0
  12. energistics/etp/v12/protocol/store/__init__.py +27 -0
  13. energistics/etp/v12/protocol/transaction/__init__.py +27 -0
  14. pyetp/__init__.py +1 -2
  15. pyetp/_version.py +2 -2
  16. pyetp/client.py +426 -306
  17. pyetp/errors.py +39 -0
  18. pyetp/uri.py +3 -1
  19. pyetp/utils_arrays.py +1 -7
  20. pyetp/utils_xml.py +1 -6
  21. {pyetp-0.0.45.dist-info → pyetp-0.0.47.dist-info}/METADATA +8 -3
  22. pyetp-0.0.47.dist-info/RECORD +39 -0
  23. {pyetp-0.0.45.dist-info → pyetp-0.0.47.dist-info}/WHEEL +1 -1
  24. {pyetp-0.0.45.dist-info → pyetp-0.0.47.dist-info}/top_level.txt +2 -0
  25. rddms_io/__init__.py +0 -0
  26. rddms_io/client.py +1234 -0
  27. rddms_io/data_types.py +11 -0
  28. resqml_objects/epc_readers.py +3 -7
  29. resqml_objects/parsers.py +18 -5
  30. resqml_objects/serializers.py +25 -2
  31. resqml_objects/surface_helpers.py +295 -0
  32. resqml_objects/v201/generated.py +582 -19
  33. resqml_objects/v201/utils.py +38 -0
  34. pyetp-0.0.45.dist-info/RECORD +0 -21
  35. {pyetp-0.0.45.dist-info → pyetp-0.0.47.dist-info}/licenses/LICENSE.md +0 -0
pyetp/errors.py ADDED
@@ -0,0 +1,39 @@
1
+ import typing
2
+
3
+
4
+ class ETPTransactionFailure(Exception):
5
+ pass
6
+
7
+
8
+ T = typing.TypeVar("T")
9
+
10
+
11
+ def parse_response_errors(
12
+ responses: list[T], expected: typing.Type[T]
13
+ ) -> list[TypeError]:
14
+ errors = []
15
+ for response in responses:
16
+ if not isinstance(response, expected):
17
+ errors.append(
18
+ TypeError(
19
+ f"Expected {expected.__name__}, got "
20
+ f"{response.__class__.__name__} with content: {response}",
21
+ )
22
+ )
23
+
24
+ return errors
25
+
26
+
27
+ def raise_response_errors(errors: list[TypeError], location: str) -> None:
28
+ if len(errors) > 0:
29
+ raise ExceptionGroup(
30
+ f"There were {len(errors)} errors in {location}",
31
+ errors,
32
+ )
33
+
34
+
35
+ def parse_and_raise_response_errors(
36
+ responses: list[T], expected: typing.Type[T], location: str
37
+ ) -> None:
38
+ errors = parse_response_errors(responses, expected)
39
+ raise_response_errors(errors, location)
pyetp/uri.py CHANGED
@@ -83,7 +83,9 @@ class DataObjectURI(_DataObjectURI, _Mixin):
83
83
  obj.Meta, "target_namespace"
84
84
  )
85
85
  namespace = namespace.lower()
86
- # TODO: we can rather look at citation.format - which could be used for xmlformat ? - however to be backward capatiable we check namespaces instead
86
+ # TODO: we can rather look at citation.format - which could be used
87
+ # for xmlformat ? - however to be backward capatiable we check
88
+ # namespaces instead
87
89
  if namespace.endswith("resqmlv2"):
88
90
  domain = "resqml20"
89
91
  elif namespace.endswith("data/commonv2"):
pyetp/utils_arrays.py CHANGED
@@ -1,4 +1,3 @@
1
- import sys
2
1
  import typing as T
3
2
 
4
3
  import numpy as np
@@ -50,12 +49,7 @@ _ANY_LOGICAL_ARRAY_TYPE_MAP: dict[npt.DTypeLike, AnyLogicalArrayType] = {
50
49
  }
51
50
 
52
51
  valid_logical_array_dtypes = list(_ANY_LOGICAL_ARRAY_TYPE_MAP)
53
- if (sys.version_info.major, sys.version_info.minor) == (3, 10):
54
- LogicalArrayDTypes: T.TypeAlias = T.Union[
55
- tuple(v.type for v in valid_logical_array_dtypes)
56
- ]
57
- else:
58
- LogicalArrayDTypes: T.TypeAlias = T.Union[tuple(valid_logical_array_dtypes)]
52
+ LogicalArrayDTypes: T.TypeAlias = T.Union[tuple(valid_logical_array_dtypes)]
59
53
 
60
54
  _INV_ANY_LOGICAL_ARRAY_TYPE_MAP: dict[AnyLogicalArrayType, npt.DTypeLike] = {
61
55
  v: k for k, v in _ANY_LOGICAL_ARRAY_TYPE_MAP.items()
pyetp/utils_xml.py CHANGED
@@ -118,13 +118,8 @@ def instantiate_resqml_grid(
118
118
  grid2d_patch=ro.Grid2dPatch(
119
119
  # TODO: Perhaps we can use this for tiling?
120
120
  patch_index=0,
121
- # NumPy-arrays are C-ordered, meaning that the last index is
122
- # the index that changes most rapidly. However, xtgeo uses nrow for
123
- # axis 1 in the array, and ncol for axis 0. This means that
124
- # surf.nrow is the fastest changing axis, and surf.ncol the slowest
125
- # changing axis (as surf.values.shape == (surf.ncol, surf.nrow))
126
- fastest_axis_count=ny,
127
121
  slowest_axis_count=nx,
122
+ fastest_axis_count=ny,
128
123
  geometry=ro.PointGeometry(
129
124
  local_crs=get_data_object_reference(crs),
130
125
  points=ro.Point3dZValueArray(
@@ -1,16 +1,15 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyetp
3
- Version: 0.0.45
3
+ Version: 0.0.47
4
4
  Summary: Interface with OSDU RDDMS using ETP protocol
5
5
  Author-email: Adam Cheng <52572642+adamchengtkc@users.noreply.github.com>
6
6
  License-Expression: Apache-2.0
7
7
  Project-URL: homepage, https://github.com/equinor/pyetp
8
8
  Classifier: Development Status :: 3 - Alpha
9
- Classifier: Programming Language :: Python :: 3.10
10
9
  Classifier: Programming Language :: Python :: 3.11
11
10
  Classifier: Programming Language :: Python :: 3.12
12
11
  Classifier: Programming Language :: Python :: 3.13
13
- Requires-Python: >=3.10
12
+ Requires-Python: >=3.11
14
13
  Description-Content-Type: text/markdown
15
14
  License-File: LICENSE.md
16
15
  Requires-Dist: numpy>=1.26.0
@@ -29,6 +28,12 @@ Dynamic: license-file
29
28
  [![PyPI version](https://badge.fury.io/py/pyetp.svg)](https://badge.fury.io/py/pyetp)
30
29
  ![License](https://img.shields.io/github/license/equinor/pyetp)
31
30
 
31
+ Pyetp is a library implementing an ETP v1.2 client with utilities and support
32
+ for working with RESQML v2.0.1 models.
33
+
34
+ > The following Energistics (c) products were used in the creation of this work:
35
+ > Energistics Transfer Protocol (ETP) v1.2 and RESQML v2.0.1
36
+
32
37
  # Installing the library
33
38
  This package is published to PyPI, and can be installed via:
34
39
  ```bash
@@ -0,0 +1,39 @@
1
+ energistics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ energistics/etp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ energistics/etp/v12/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ energistics/etp/v12/datatypes/__init__.py,sha256=D2cMhZmI0dgzmf3so-cwWrZgfHxqE-lSmiZUbHlqNKo,921
5
+ energistics/etp/v12/datatypes/data_array_types/__init__.py,sha256=WlAZxhgV1rSz01z3HTl28hdjyztohVBI7HAvntnCH4M,920
6
+ energistics/etp/v12/datatypes/object/__init__.py,sha256=jo3OmKenD6VkKiXV-gMuwzEcJl4pj2PYJRqYsi8jp6Y,752
7
+ energistics/etp/v12/protocol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ energistics/etp/v12/protocol/core/__init__.py,sha256=e7QpxLdKNezGtfSOX_KuiIQJ9hgDGBPqqioq34KXHJA,668
9
+ energistics/etp/v12/protocol/data_array/__init__.py,sha256=db42SuhwsGYnsLxSzGBJhNv0dbTnXIt8hLIuCy0104o,1777
10
+ energistics/etp/v12/protocol/dataspace/__init__.py,sha256=CaprHZZgA5JzMbV_BHTyFwHBL8r0sIW_qa9lqBzCwCM,804
11
+ energistics/etp/v12/protocol/discovery/__init__.py,sha256=lu_IsAZP5886OeZuihtNLnREsIim4Tenpnv52G5wcag,721
12
+ energistics/etp/v12/protocol/store/__init__.py,sha256=2wvK_cN_Dc3cl4pDHuWhQW6QcCResV9rPNMtESQSIa8,894
13
+ energistics/etp/v12/protocol/transaction/__init__.py,sha256=1_dv1c8ahKJH2kM9PuMiSZ5FwwWjghmkc397YK5ming,894
14
+ pyetp/__init__.py,sha256=nh-eVYEWMMxqx4YZLzN7fV7NXwbutr1soD_ot48860U,283
15
+ pyetp/_version.py,sha256=ToAw384WWguTEmRR8YKQKk9ZB9M3thyPsfPaIkOPqog,706
16
+ pyetp/client.py,sha256=CP_cNxW0PROnXMnCUkr00UAKHZCccb3bCn1cZqgO_94,56598
17
+ pyetp/config.py,sha256=uGEx6n-YF7Rtgwckf0ovRKNOKgCUsiQx4IA0Tyiqafk,870
18
+ pyetp/errors.py,sha256=J8137kpSJb4mjTNR9EOmPVvyYSptGeBMmwDQzC7I1NU,964
19
+ pyetp/resqml_objects.py,sha256=j00e8scSh-yYv4Lpp9WjzLiaKqJWd5Cs7ROcJcxxFVw,50721
20
+ pyetp/types.py,sha256=zOfUzEQcgBvveWJyM6dD7U3xJ4SCkWElewNL0Ml-PPY,6761
21
+ pyetp/uri.py,sha256=zbwAeyqLgRqgN-xAbOYmiTtHtVJwfveaMbjl7yc2ifU,3143
22
+ pyetp/utils_arrays.py,sha256=P9F_FWxf9IkqMI1CDdoRjKqD1bWB5DCOJWdHrT7UHfQ,13251
23
+ pyetp/utils_xml.py,sha256=qETAMooFWXBvV_SIMGv1TEG2tLWCbgPraARkftqblKw,6444
24
+ pyetp-0.0.47.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
+ rddms_io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ rddms_io/client.py,sha256=IQR5Xas45RO1BGzjelxhljDbvhWEGSf36NBBcmuc5BQ,45543
27
+ rddms_io/data_types.py,sha256=jLZSuAA9Ds-4_K2N5JS9K92sVUfaOjgx3ToANwW-VaI,272
28
+ resqml_objects/__init__.py,sha256=ilimTrQScFryxHrfZwZURVpW0li19bVnayUcHR7S_Fs,183
29
+ resqml_objects/epc_readers.py,sha256=-k2GGK8VgVoqX3-ThyLjs_5OlgNHu1Sd4LZAq6YSF18,3306
30
+ resqml_objects/parsers.py,sha256=aX7W4sP68NlEp8bFB88A8mXWpBHmr79ahpvgD04vCdY,724
31
+ resqml_objects/serializers.py,sha256=wgWhO7ynn51cWRvt5BKdLvxZRqWuopoHFQn0tX8d2NA,1155
32
+ resqml_objects/surface_helpers.py,sha256=-x9DqCliI0dUP4ierTypVFWx7eOH_0j6iDdLxzpGPtk,11207
33
+ resqml_objects/v201/__init__.py,sha256=yL3jWgkyGAzr-wt_WJDV_eARE75NoA6SPEKBrKM4Crk,51630
34
+ resqml_objects/v201/generated.py,sha256=tjOgaa05rfutRUensPp7K1xBkmbZrPAprKVDRNLtvNw,790733
35
+ resqml_objects/v201/utils.py,sha256=ENihJet58GUd91pkOeX70IgFV11S7oha1440LaHpamY,2476
36
+ pyetp-0.0.47.dist-info/METADATA,sha256=-8EKZFgS3tJRXnFpxU6fjPITIjrZ93hDZbv_TazpvvA,3096
37
+ pyetp-0.0.47.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
38
+ pyetp-0.0.47.dist-info/top_level.txt,sha256=NSSMMgk5xHeouCZ2cyBoq4KxcHKN60pejJFCCW-QL4s,42
39
+ pyetp-0.0.47.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,2 +1,4 @@
1
+ energistics
1
2
  pyetp
3
+ rddms_io
2
4
  resqml_objects
rddms_io/__init__.py ADDED
File without changes