pninexus 3.3.0__cp310-cp310-manylinux_2_35_x86_64.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 (79) hide show
  1. pninexus/__init__.py +6 -0
  2. pninexus/filters/__init__.py +7 -0
  3. pninexus/filters/libh5LZF.so +0 -0
  4. pninexus/filters/libh5blosc.so +0 -0
  5. pninexus/filters/libh5bshuf.so +0 -0
  6. pninexus/filters/libh5bz2.so +0 -0
  7. pninexus/filters/libh5jpeg.so +0 -0
  8. pninexus/filters/libh5lz4.so +0 -0
  9. pninexus/filters/libh5mafisc.so +0 -0
  10. pninexus/filters/libh5zfp.so +0 -0
  11. pninexus/filters/liblzf_filter.so +0 -0
  12. pninexus/h5cpp/__init__.py +28 -0
  13. pninexus/h5cpp/_attribute.cpython-310-x86_64-linux-gnu.so +0 -0
  14. pninexus/h5cpp/_dataspace.cpython-310-x86_64-linux-gnu.so +0 -0
  15. pninexus/h5cpp/_datatype.cpython-310-x86_64-linux-gnu.so +0 -0
  16. pninexus/h5cpp/_file.cpython-310-x86_64-linux-gnu.so +0 -0
  17. pninexus/h5cpp/_filter.cpython-310-x86_64-linux-gnu.so +0 -0
  18. pninexus/h5cpp/_h5cpp.cpython-310-x86_64-linux-gnu.so +0 -0
  19. pninexus/h5cpp/_node.cpython-310-x86_64-linux-gnu.so +0 -0
  20. pninexus/h5cpp/_property.cpython-310-x86_64-linux-gnu.so +0 -0
  21. pninexus/h5cpp/attribute/__init__.py +65 -0
  22. pninexus/h5cpp/dataspace/__init__.py +18 -0
  23. pninexus/h5cpp/datatype/__init__.py +183 -0
  24. pninexus/h5cpp/file/__init__.py +15 -0
  25. pninexus/h5cpp/filter/__init__.py +37 -0
  26. pninexus/h5cpp/node/__init__.py +466 -0
  27. pninexus/h5cpp/property/__init__.py +71 -0
  28. pninexus/nexus/__init__.py +192 -0
  29. pninexus/nexus/_nexus.cpython-310-x86_64-linux-gnu.so +0 -0
  30. pninexus-3.3.0.dist-info/LICENSE +339 -0
  31. pninexus-3.3.0.dist-info/METADATA +184 -0
  32. pninexus-3.3.0.dist-info/RECORD +79 -0
  33. pninexus-3.3.0.dist-info/WHEEL +5 -0
  34. pninexus-3.3.0.dist-info/top_level.txt +1 -0
  35. pninexus.libs/libaec-df4ff8a4.so.0.0.12 +0 -0
  36. pninexus.libs/libblosc-1a5323ad.so.1.21.1 +0 -0
  37. pninexus.libs/libboost_python310-80079748.so.1.74.0 +0 -0
  38. pninexus.libs/libboost_regex-e2b8b679.so.1.74.0 +0 -0
  39. pninexus.libs/libbrotlicommon-abf86ae9.so.1.0.9 +0 -0
  40. pninexus.libs/libbrotlidec-db9dbda7.so.1.0.9 +0 -0
  41. pninexus.libs/libbz2-5e516f77.so.1.0.4 +0 -0
  42. pninexus.libs/libcom_err-f196091d.so.2.1 +0 -0
  43. pninexus.libs/libcrypto-ee446395.so.3 +0 -0
  44. pninexus.libs/libcurl-4a475a33.so.4.7.0 +0 -0
  45. pninexus.libs/libffi-247da4d5.so.8.1.0 +0 -0
  46. pninexus.libs/libgmp-4dc20a90.so.10.4.1 +0 -0
  47. pninexus.libs/libgnutls-029add8e.so.30.31.0 +0 -0
  48. pninexus.libs/libgssapi_krb5-ef9ec823.so.2.2 +0 -0
  49. pninexus.libs/libh5cpp-cf5d864b.so.0.7.1 +0 -0
  50. pninexus.libs/libhdf5_serial-12e4461a.so.103.3.0 +0 -0
  51. pninexus.libs/libhdf5_serial_hl-701cc4c7.so.100.1.4 +0 -0
  52. pninexus.libs/libhogweed-47d56894.so.6.4 +0 -0
  53. pninexus.libs/libicudata-c1404396.so.70.1 +0 -0
  54. pninexus.libs/libicui18n-24fa78ca.so.70.1 +0 -0
  55. pninexus.libs/libicuuc-4683f362.so.70.1 +0 -0
  56. pninexus.libs/libidn2-1420c60a.so.0.3.7 +0 -0
  57. pninexus.libs/libjpeg-2cfbcf67.so.8.2.2 +0 -0
  58. pninexus.libs/libk5crypto-6625483f.so.3.1 +0 -0
  59. pninexus.libs/libkeyutils-ad20d5fb.so.1.9 +0 -0
  60. pninexus.libs/libkrb5-8b125d47.so.3.3 +0 -0
  61. pninexus.libs/libkrb5support-9061fd80.so.0.1 +0 -0
  62. pninexus.libs/liblber-2-07024854.5.so.0.1.13 +0 -0
  63. pninexus.libs/libldap-2-9e9c4a26.5.so.0.1.13 +0 -0
  64. pninexus.libs/liblz4-65f47a3d.so.1.9.3 +0 -0
  65. pninexus.libs/liblzf-2b4a8e1a.so.1.5 +0 -0
  66. pninexus.libs/libnettle-2d3bda6c.so.8.4 +0 -0
  67. pninexus.libs/libnghttp2-1cc16764.so.14.20.1 +0 -0
  68. pninexus.libs/libp11-kit-d2b01eaa.so.0.3.0 +0 -0
  69. pninexus.libs/libpninexus-82078339.so.3.3.0 +0 -0
  70. pninexus.libs/libpsl-95ca960e.so.5.3.2 +0 -0
  71. pninexus.libs/librtmp-2401c4fc.so.1 +0 -0
  72. pninexus.libs/libsasl2-344870a9.so.2.0.25 +0 -0
  73. pninexus.libs/libsnappy-0b6e39db.so.1.1.8 +0 -0
  74. pninexus.libs/libssh-c00fffad.so.4.8.7 +0 -0
  75. pninexus.libs/libssl-4194be63.so.3 +0 -0
  76. pninexus.libs/libsz-53f3c9c7.so.2.0.1 +0 -0
  77. pninexus.libs/libtasn1-5982aae4.so.6.6.2 +0 -0
  78. pninexus.libs/libunistring-9c28d595.so.2.2.0 +0 -0
  79. pninexus.libs/libzstd-5df4f4df.so.1.4.8 +0 -0
pninexus/__init__.py ADDED
@@ -0,0 +1,6 @@
1
+ __path__ = __import__('pkgutil').extend_path(__path__, __name__)
2
+
3
+ try:
4
+ from . import filters
5
+ except ImportError:
6
+ pass
@@ -0,0 +1,7 @@
1
+ """
2
+ :py:mod:`pninexus.filters` is a path setter for HDF5_PLUGIN_PATH
3
+ """
4
+ import os
5
+ from pathlib import Path
6
+
7
+ os.environ["HDF5_PLUGIN_PATH"] = os.path.split(Path(__file__))[0]
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,28 @@
1
+ """
2
+ :py:mod:`pninexus.io.h5cpp` is a thin wrapper around the *h5cpp* C++
3
+ library where every
4
+ namespace in the C++ library has a counterpart as a sub-package of
5
+ :py:mod:`pninexus.io.h5cpp`
6
+ """
7
+
8
+
9
+ from pninexus.h5cpp import _h5cpp
10
+ from pninexus.h5cpp import attribute
11
+ from pninexus.h5cpp import dataspace
12
+ from pninexus.h5cpp import datatype
13
+ from pninexus.h5cpp import file
14
+ from pninexus.h5cpp import filter
15
+ from pninexus.h5cpp import node
16
+ from pninexus.h5cpp import property
17
+
18
+ from pninexus.h5cpp._h5cpp import IteratorConfig
19
+ from pninexus.h5cpp._h5cpp import IterationOrder
20
+ from pninexus.h5cpp._h5cpp import IterationIndex
21
+ from pninexus.h5cpp._h5cpp import Path
22
+ from pninexus.h5cpp._h5cpp import print_hdf5_errors
23
+ from pninexus.h5cpp._h5cpp import current_library_version
24
+
25
+ __all__ = ["IteratorConfig", "IterationOrder", "IterationIndex", "Path",
26
+ "print_hdf5_errors", "current_library_version",
27
+ "attribute", "dataspace", "datatype", "file", "filter", "node",
28
+ "property", "_h5cpp"]
@@ -0,0 +1,65 @@
1
+ from __future__ import print_function
2
+ import numpy
3
+ import sys
4
+
5
+ from pninexus.h5cpp import property
6
+ from pninexus.h5cpp._attribute import AttributeManager
7
+ from pninexus.h5cpp._attribute import Attribute
8
+
9
+ __all__ = ["property", "AttributeManager", "Attribute"]
10
+
11
+
12
+ if sys.version_info > (3,):
13
+ unicode = str
14
+
15
+
16
+ def attribute__getitem__(self, index):
17
+
18
+ data = self.read()
19
+
20
+ return data[index]
21
+
22
+
23
+ def attribute_write(self, data):
24
+
25
+ write_data = data
26
+ if not isinstance(write_data, numpy.ndarray):
27
+ write_data = numpy.array(write_data)
28
+ if write_data.dtype.kind == 'U':
29
+ try:
30
+ write_data = write_data.astype("S")
31
+ except Exception:
32
+ if isinstance(data, numpy.ndarray) and data.shape:
33
+ shape = data.shape
34
+ if len(shape) > 1:
35
+ data = data.flatten()
36
+ write_data = numpy.array(
37
+ [bytes(unicode(dt).encode('utf-8')) for dt in data])
38
+ if len(shape) > 1:
39
+ write_data = write_data.reshape(shape)
40
+ else:
41
+ write_data = numpy.array(unicode(data).encode('utf-8'))
42
+ elif write_data.dtype == 'bool':
43
+ write_data = write_data.astype("int8")
44
+
45
+ # print("DATA", data, write_data)
46
+ try:
47
+ self._write(write_data)
48
+ except RuntimeError as e:
49
+ print(str(e))
50
+ print(write_data, write_data.dtype)
51
+
52
+
53
+ def attribute_read(self):
54
+
55
+ read_data = self._read()
56
+
57
+ if isinstance(read_data, numpy.ndarray) and read_data.dtype.kind == 'S':
58
+ return read_data.astype('U')
59
+ else:
60
+ return read_data
61
+
62
+
63
+ Attribute.__getitem__ = attribute__getitem__
64
+ Attribute.write = attribute_write
65
+ Attribute.read = attribute_read
@@ -0,0 +1,18 @@
1
+ from pninexus.h5cpp._dataspace import Dataspace
2
+ from pninexus.h5cpp._dataspace import Type
3
+ from pninexus.h5cpp._dataspace import Simple
4
+ from pninexus.h5cpp._dataspace import Scalar
5
+ from pninexus.h5cpp._dataspace import UNLIMITED
6
+
7
+ # from .._dataspace import Selection
8
+ from pninexus.h5cpp._dataspace import SelectionManager
9
+ from pninexus.h5cpp._dataspace import Hyperslab
10
+ from pninexus.h5cpp._dataspace import Points
11
+ from pninexus.h5cpp._dataspace import SelectionType
12
+ from pninexus.h5cpp._dataspace import SelectionOperation
13
+ from pninexus.h5cpp._dataspace import View
14
+
15
+ __all__ = ["Dataspace", "Type", "Simple", "Scalar", "UNLIMITED",
16
+ "SelectionManager",
17
+ "Hyperslab", "SelectionType", "SelectionOperation", "View",
18
+ "Points"]
@@ -0,0 +1,183 @@
1
+ #
2
+ # Import enumerations
3
+ #
4
+ from pninexus.h5cpp._datatype import Class
5
+ from pninexus.h5cpp._datatype import Order
6
+ from pninexus.h5cpp._datatype import Sign
7
+ from pninexus.h5cpp._datatype import Norm
8
+ from pninexus.h5cpp._datatype import Pad
9
+ from pninexus.h5cpp._datatype import StringPad
10
+ from pninexus.h5cpp._datatype import Direction
11
+ from pninexus.h5cpp._datatype import CharacterEncoding
12
+
13
+ #
14
+ # Import classes
15
+ #
16
+ from pninexus.h5cpp._datatype import Datatype
17
+ from pninexus.h5cpp._datatype import Float
18
+ from pninexus.h5cpp._datatype import Integer
19
+ from pninexus.h5cpp._datatype import Compound
20
+ from pninexus.h5cpp._datatype import String
21
+ from pninexus.h5cpp._datatype import Enum
22
+
23
+ #
24
+ # Import predefined constant types
25
+ #
26
+ from pninexus.h5cpp._datatype import kUInt8
27
+ from pninexus.h5cpp._datatype import kInt8
28
+ from pninexus.h5cpp._datatype import kUInt16
29
+ from pninexus.h5cpp._datatype import kInt16
30
+ from pninexus.h5cpp._datatype import kUInt32
31
+ from pninexus.h5cpp._datatype import kInt32
32
+ from pninexus.h5cpp._datatype import kUInt64
33
+ from pninexus.h5cpp._datatype import kInt64
34
+ from pninexus.h5cpp._datatype import kFloat16
35
+ from pninexus.h5cpp._datatype import kFloat32
36
+ from pninexus.h5cpp._datatype import kFloat64
37
+ from pninexus.h5cpp._datatype import kFloat128
38
+ from pninexus.h5cpp._datatype import kComplex32
39
+ from pninexus.h5cpp._datatype import kComplex64
40
+ from pninexus.h5cpp._datatype import kComplex128
41
+ from pninexus.h5cpp._datatype import kComplex256
42
+ from pninexus.h5cpp._datatype import kVariableString
43
+ from pninexus.h5cpp._datatype import kEBool
44
+
45
+ from pninexus.h5cpp._datatype import is_bool
46
+
47
+
48
+ class Factory(object):
49
+ """Construct HDF5 datatypes from numpy types
50
+
51
+ """
52
+
53
+ type_map = {
54
+ "bool": kEBool,
55
+ "int8": kInt8,
56
+ "uint8": kUInt8,
57
+ "int16": kInt16,
58
+ "uint16": kUInt16,
59
+ "int32": kInt32,
60
+ "uint32": kUInt32,
61
+ "int64": kInt64,
62
+ "uint64": kUInt64,
63
+ "float16": kFloat16,
64
+ "float32": kFloat32,
65
+ "float64": kFloat64,
66
+ "float128": kFloat128,
67
+ "complex32": kComplex32,
68
+ "complex64": kComplex64,
69
+ "complex128": kComplex128,
70
+ "complex256": kComplex256,
71
+ }
72
+
73
+ def create(self, dtype):
74
+ """Create HDF5 type from numpy type
75
+
76
+ :param numpy.dtype dtype: numpy datat type
77
+ :return: HDF5 datatype
78
+ :rtype: Datatype
79
+ """
80
+
81
+ if dtype.kind == 'S' or dtype.kind == 'U':
82
+ if dtype.itemsize != 0:
83
+ type = String.fixed(dtype.itemsize)
84
+ type.padding = StringPad.NULLPAD
85
+ return type
86
+ else:
87
+ return String.variable()
88
+ else:
89
+ return self.type_map[dtype.name]
90
+
91
+
92
+ kFactory = Factory()
93
+
94
+
95
+ def to_numpy(hdf5_datatype):
96
+ """Convert an HDF5 datatype to a numpy type
97
+
98
+ Takes an HDF5 datatype and converts it to the string representation
99
+ of its numpy counterpart.
100
+
101
+ :param Datatype hdf5_datatype: the HDF5 datatype to convert
102
+ :return: numpy type
103
+ :rtype: str
104
+ """
105
+
106
+ if not isinstance(hdf5_datatype, Datatype):
107
+ raise TypeError("Instance of an HDF5 datatype required!")
108
+
109
+ if hdf5_datatype == kInt8:
110
+ return "int8"
111
+ elif hdf5_datatype == kUInt8:
112
+ return "uint8"
113
+ elif hdf5_datatype == kInt16:
114
+ return "int16"
115
+ elif hdf5_datatype == kUInt16:
116
+ return "uint16"
117
+ elif hdf5_datatype == kInt32:
118
+ return "int32"
119
+ elif hdf5_datatype == kUInt32:
120
+ return "uint32"
121
+ elif hdf5_datatype == kInt64:
122
+ return "int64"
123
+ elif hdf5_datatype == kUInt64:
124
+ return "uint64"
125
+ elif hdf5_datatype == kFloat16:
126
+ return "float16"
127
+ elif hdf5_datatype == kFloat32:
128
+ return "float32"
129
+ elif hdf5_datatype == kFloat64:
130
+ return "float64"
131
+ elif hdf5_datatype == kFloat128:
132
+ return "float128"
133
+ elif hdf5_datatype == kComplex32:
134
+ return "complex32"
135
+ elif hdf5_datatype == kComplex64:
136
+ return "complex64"
137
+ elif hdf5_datatype == kComplex128:
138
+ return "complex128"
139
+ elif hdf5_datatype == kComplex256:
140
+ return "complex256"
141
+ elif hdf5_datatype == kEBool:
142
+ return "bool"
143
+ elif isinstance(hdf5_datatype, String):
144
+ if hdf5_datatype.is_variable_length:
145
+ return "object"
146
+ else:
147
+ return "S{}".format(hdf5_datatype.size)
148
+ else:
149
+ raise ValueError("Unsupported HDF5 datatype!")
150
+
151
+
152
+ def compound_getitem(self, key):
153
+ """ get comound item datatype
154
+
155
+ :param key: field index or field name
156
+ :type key: `obj`:int: or `obj`:str:
157
+ :returns: datatype
158
+ :raises RuntimeError: in case of a failure
159
+ """
160
+ dt = self._getitem(key)
161
+ if dt.type == Class.FLOAT:
162
+ return Float(dt)
163
+ if dt.type == Class.INTEGER:
164
+ return Integer(dt)
165
+ if dt.type == Class.STRING:
166
+ return String(dt)
167
+ if dt.type == Class.ENUM:
168
+ return Enum(dt)
169
+ return dt
170
+
171
+
172
+ Compound.__getitem__ = compound_getitem
173
+
174
+
175
+ __all__ = ["Class", "Order", "Sign", "Norm", "Pad", "StringPad", "Direction",
176
+ "CharacterEncoding", "Datatype", "Float", "Integer", "String",
177
+ "Compound",
178
+ "kUInt8", "kInt8", "kUInt16", "kInt16", "kUInt32", "kInt32",
179
+ "kUInt64", "kInt64",
180
+ "kFloat16", "kFloat32", "kFloat64", "kFloat128",
181
+ "kComplex32", "kComplex64", "kComplex128", "kComplex256",
182
+ "kVariableString",
183
+ "Factory", "kFactory", "to_numpy", "kEBool", "is_bool", "Enum"]
@@ -0,0 +1,15 @@
1
+ from pninexus.h5cpp._file import File
2
+ from pninexus.h5cpp._file import AccessFlags
3
+ from pninexus.h5cpp._file import ImageFlags
4
+ from pninexus.h5cpp._file import Scope
5
+
6
+ #
7
+ # utility functions
8
+ #
9
+ from pninexus.h5cpp._file import create
10
+ from pninexus.h5cpp._file import open
11
+ from pninexus.h5cpp._file import is_hdf5_file
12
+ from pninexus.h5cpp._file import from_buffer
13
+
14
+ __all__ = ["File", "ImageFlags", "AccessFlags", "Scope", "create", "open",
15
+ "is_hdf5_file", "from_buffer"]
@@ -0,0 +1,37 @@
1
+ from pninexus.h5cpp._filter import Filter
2
+ from pninexus.h5cpp._filter import Deflate
3
+ from pninexus.h5cpp._filter import Shuffle
4
+ from pninexus.h5cpp._filter import Fletcher32
5
+ from pninexus.h5cpp._filter import NBit
6
+ from pninexus.h5cpp._filter import SZip
7
+ from pninexus.h5cpp._filter import SZipOptionMask
8
+ from pninexus.h5cpp._filter import ScaleOffset
9
+ from pninexus.h5cpp._filter import SOScaleType
10
+ from pninexus.h5cpp._filter import ExternalFilter
11
+ from pninexus.h5cpp._filter import Availability
12
+ from pninexus.h5cpp._filter import is_filter_available
13
+ from pninexus.h5cpp._filter import _externalfilters_fill
14
+
15
+
16
+ class ExternalFilters(list):
17
+ """ List of ExternalFilters"""
18
+
19
+ def fill(self, dcpl, max_cd_number=16, max_name_size=257):
20
+ """ fills the list with conntent provided by DatasetCreationList
21
+
22
+ :param dcpl: dataset creationlist
23
+ :type dcpl: :class:`DatasetCreationList`
24
+ :param max_cd_number: maximal cd parameters number
25
+ :type max_cd_number: int
26
+ :param max_name_size: maximal name size
27
+ :type max_name_size: int
28
+ :returns: a list of Availability flags
29
+ :rtype: :obj: `list` <:class:`Availability`>
30
+ """
31
+ return _externalfilters_fill(self, dcpl, max_cd_number, max_name_size)
32
+
33
+
34
+ __all__ = ["Filter", "Deflate", "Shuffle", "Fletcher32", "NBit", "SZip",
35
+ "SZippOptionMask"
36
+ "ExternalFilter", "ExternalFilters", "Availability", "ScaleOffset",
37
+ "SOScaleType", "is_filter_available"]