h2lib 0.0.4__cp38-cp38-win_amd64.whl → 13.0.404__cp38-cp38-win_amd64.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.
h2lib/HAWC2Lib.dll ADDED
Binary file
h2lib/_h2lib.py ADDED
@@ -0,0 +1,28 @@
1
+ import numpy as np
2
+ from h2lib.dll_wrapper import DLLWrapper
3
+ import os
4
+
5
+ from h2lib.h2lib_signatures import H2LibSignatures
6
+ in_use = None
7
+
8
+
9
+ class H2Lib(H2LibSignatures, DLLWrapper):
10
+ def __init__(self, filename=None):
11
+ if filename is None:
12
+ if os.name == 'nt':
13
+ filename = os.path.dirname(__file__) + '/HAWC2Lib.dll'
14
+ else:
15
+ filename = os.path.dirname(__file__) + '/HAWC2Lib.so'
16
+
17
+ DLLWrapper.__init__(self, filename, cdecl=True)
18
+
19
+ def getState(self):
20
+ return H2LibSignatures.getState(self, restype=np.int32)
21
+
22
+
23
+ if __name__ == '__main__':
24
+ h2lib = H2Lib()
25
+ h2lib.echo_version()
26
+ (s,), res = h2lib.get_version("")
27
+ print("#" + s + "#")
28
+ print(h2lib.getSquare(3., restype=np.float64))
@@ -1,236 +1,255 @@
1
- import numpy as np
2
- from numpy.ctypeslib import ndpointer
3
- import ctypes as ct
4
- import _ctypes
5
-
6
- import os
7
- import ctypes
8
- from _ctypes import POINTER
9
- from ctypes import c_int, c_double, c_char, c_char_p, c_long
10
- try:
11
- from ctypes import windll
12
- except ImportError:
13
- pass
14
- import sys
15
- from pathlib import Path
16
- import atexit
17
- c_int_p = POINTER(ctypes.c_long)
18
- c_double_p = POINTER(ctypes.c_double)
19
-
20
-
21
- class DLLWrapper(object):
22
- def __init__(self, filename, cdecl=True):
23
- self.filename = str(filename)
24
- self.cdecl = cdecl
25
- self.open()
26
- atexit.register(self.close)
27
-
28
- @staticmethod
29
- def find_dll(path, name):
30
- p = Path(path)
31
-
32
- # if sys.platform == "win32":
33
- # prefixes = ['']
34
- # if sys.maxsize > 2**32:
35
- # suffixes = ['.dll', '_64.dll']
36
- # else:
37
- # suffixes = ['.dll']
38
- # elif sys.platform == 'linux':
39
- # prefixes = ['lib','']
40
- # suffixes = ['.so']
41
- # else:
42
- # raise NotImplementedError()
43
-
44
- dll_lst = []
45
- file_patterns = ['*%s*.dll' % name, '*%s*.so' % name]
46
- for fp in file_patterns:
47
- dll_lst.extend(list(p.glob("**/" + fp)))
48
-
49
- def use_first(dll_lst):
50
- f = str(dll_lst[0])
51
- print("Using ", os.path.abspath(f))
52
- return DLLWrapper(f)
53
-
54
- if len(dll_lst) == 1:
55
- return use_first(dll_lst)
56
- elif len(dll_lst) > 1:
57
- # check if excluding dlls in hawc2-binary, i.e. "hawc2-<platform>" results in one dll
58
- dll_lst2 = [d for d in dll_lst if not str(d).startswith('hawc2-')]
59
- if len(dll_lst2) == 1:
60
- return use_first(dll_lst2)
61
- raise FileExistsError("Multiple dlls found:\n" + "\n".join([str(p) for p in dll_lst]))
62
- else:
63
- raise FileNotFoundError("No " + " or ".join(file_patterns) +
64
- " files found in " + os.path.abspath(p.absolute()))
65
-
66
- def open(self):
67
- assert os.path.isfile(self.filename), os.path.abspath(self.filename)
68
- if self.cdecl:
69
- self.lib = ct.CDLL(self.filename, winmode=ctypes.DEFAULT_MODE)
70
- else:
71
- self.lib = windll.LoadLibrary(self.filename)
72
-
73
- def close(self):
74
- if "FreeLibrary" in dir(_ctypes):
75
- _ctypes.FreeLibrary(self.lib._handle)
76
- else:
77
- _ctypes.dlclose(self.lib._handle)
78
- atexit.unregister(self.close)
79
-
80
- # def __enter__(self):
81
- # self.open()
82
- # return self
83
- #
84
- # def __exit__(self, type, value, traceback):
85
- # self.close()
86
- # return False
87
-
88
- def __getattribute__(self, name):
89
- try:
90
- return object.__getattribute__(self, name)
91
- except AttributeError:
92
- if name == 'lib':
93
- raise Exception("DLL not loaded. Run using: 'with dll: ...'")
94
-
95
- try:
96
- f = getattr(self.lib, name)
97
- except AttributeError as e:
98
- raise AttributeError("Attribute '%s' not found in dll ('%s')" % (name, self.filename))
99
-
100
- def wrap(*args, **kwargs):
101
- c_args = []
102
- for arg in args:
103
- if isinstance(arg, int):
104
- c_args.append(c_int_p(c_int(arg)))
105
- elif isinstance(arg, float):
106
- c_args.append(c_double_p(c_double(arg)))
107
- elif isinstance(arg, str):
108
- c_args.append(c_char_p(arg.encode('cp1252')))
109
- # c_args.append(c_int_p(c_int(len(arg))))
110
-
111
- elif isinstance(arg, np.ndarray):
112
- if arg.dtype == int:
113
- c_args.append(arg.ctypes.data_as(c_int_p))
114
- elif arg.dtype == np.float64:
115
- c_args.append(arg.ctypes.data_as(c_double_p))
116
- else:
117
- raise NotImplementedError(arg.dtype)
118
-
119
- else:
120
- # raise NotImplementedError(arg.__class__.__name__)
121
- c_args.append(arg)
122
- if 'restype' in kwargs:
123
- restype = kwargs['restype']
124
- if hasattr(restype, 'dtype'):
125
- restype = np.ctypeslib.as_ctypes_type(restype)
126
- f.restype = restype
127
-
128
- res = f(*c_args)
129
- ret_args = []
130
- for arg in args:
131
- c_arg = c_args.pop(0)
132
- if isinstance(arg, (int, float)):
133
- ret_args.append(c_arg.contents.value)
134
- elif isinstance(arg, (str)):
135
- ret_args.append(c_arg.value.decode('cp1252'))
136
- # c_args.pop(0)
137
- elif isinstance(arg, np.ndarray):
138
- ret_args.append(arg)
139
- else:
140
- raise NotImplementedError(arg.__class__.__name__)
141
- return ret_args, res
142
- return wrap
143
-
144
- def version(self, function_name='get_version'):
145
- try:
146
- f = getattr(self.lib, function_name)
147
- f.argtypes = [c_char_p, c_long]
148
- s = "".ljust(255)
149
- arg = c_char_p(s.encode('utf-8'))
150
- f(arg, len(s))
151
- return arg.value.decode().strip()
152
- except AttributeError:
153
- if function_name == 'get_version':
154
- return self.version('version')
155
-
156
- def getFileProperties(self):
157
- if sys.platform != "win32":
158
- raise OSError("Only supported for Windows")
159
- import win32api
160
- fname = self.filename
161
-
162
- # ==============================================================================
163
- """
164
- Read all properties of the given file return them as a dictionary.
165
- """
166
- propNames = ('Comments', 'InternalName', 'ProductName',
167
- 'CompanyName', 'LegalCopyright', 'ProductVersion',
168
- 'FileDescription', 'LegalTrademarks', 'PrivateBuild',
169
- 'FileVersion', 'OriginalFilename', 'SpecialBuild')
170
-
171
- props = {'FixedFileInfo': None, 'StringFileInfo': None, 'FileVersion': None}
172
-
173
- try:
174
- # backslash as parm returns dictionary of numeric info corresponding to VS_FIXEDFILEINFO struc
175
- fixedInfo = win32api.GetFileVersionInfo(fname, '\\')
176
- props['FixedFileInfo'] = fixedInfo
177
- props['FileVersion'] = "%d.%d.%d.%d" % (fixedInfo['FileVersionMS'] / 65536,
178
- fixedInfo['FileVersionMS'] % 65536, fixedInfo['FileVersionLS'] / 65536,
179
- fixedInfo['FileVersionLS'] % 65536)
180
-
181
- # \VarFileInfo\Translation returns list of available (language, codepage)
182
- # pairs that can be used to retreive string info. We are using only the first pair.
183
- lang, codepage = win32api.GetFileVersionInfo(fname, '\\VarFileInfo\\Translation')[0]
184
-
185
- # any other must be of the form \StringfileInfo\%04X%04X\parm_name, middle
186
- # two are language/codepage pair returned from above
187
-
188
- strInfo = {}
189
- for propName in propNames:
190
- strInfoPath = u'\\StringFileInfo\\%04X%04X\\%s' % (lang, codepage, propName)
191
- # print str_info
192
- strInfo[propName] = win32api.GetFileVersionInfo(fname, strInfoPath)
193
-
194
- props['StringFileInfo'] = strInfo
195
- except BaseException:
196
- pass
197
-
198
- return props
199
-
200
-
201
- class Type2DllWrapper(DLLWrapper):
202
- def __init__(self, filename, dll_subroutine_init, dll_subroutine_update,
203
- arraysizes_init, arraysizes_update,
204
- init_array):
205
- super().__init__(filename)
206
- self.dll_subroutine_init = dll_subroutine_init
207
- self.dll_subroutine_update = dll_subroutine_update
208
- self.arraysizes_init = arraysizes_init
209
- self.arraysizes_update = arraysizes_update
210
- self.init_array = init_array
211
-
212
- def open(self):
213
- DLLWrapper.open(self)
214
- self.init()
215
-
216
- def call(self, name, array, n1, n2):
217
- f = getattr(self.lib, name)
218
- f.argtypes = [ndpointer(shape=n1, dtype=ct.c_double, flags='FORTRAN'),
219
- ndpointer(shape=n2, dtype=ct.c_double, flags='FORTRAN')]
220
- f.restype = None
221
-
222
- pad_array = np.zeros(n1)
223
- pad_array[:len(array)] = array
224
- arg1 = np.array(pad_array, dtype=ct.c_double, order='F')
225
- arg2 = np.zeros(n2, dtype=ct.c_double, order='F')
226
-
227
- f(arg1, arg2)
228
- return(arg2)
229
-
230
- def init(self):
231
- n1, n2 = self.arraysizes_init
232
- return self.call(self.dll_subroutine_init, self.init_array, n1, n2)
233
-
234
- def update(self, array):
235
- n1, n2 = self.arraysizes_update
236
- return self.call(self.dll_subroutine_update, array, n1, n2)
1
+ import numpy as np
2
+ from numpy.ctypeslib import ndpointer
3
+ import ctypes as ct
4
+ import _ctypes
5
+ import platform
6
+ import os
7
+ import ctypes
8
+ from _ctypes import POINTER
9
+ from ctypes import c_int, c_double, c_char, c_char_p, c_long
10
+ import tempfile
11
+ import shutil
12
+ try:
13
+ from ctypes import windll
14
+ except ImportError:
15
+ pass
16
+ import sys
17
+ from pathlib import Path
18
+ import atexit
19
+ c_int_p = POINTER(ctypes.c_long)
20
+ c_double_p = POINTER(ctypes.c_double)
21
+ in_use = []
22
+
23
+
24
+ class DLLWrapper(object):
25
+ def __init__(self, filename, cdecl=True):
26
+ if filename in in_use:
27
+ self.temp_dir = tempfile.TemporaryDirectory()
28
+ tmp_filename = os.path.join(self.temp_dir.name, os.path.basename(filename))
29
+ shutil.copy(filename, tmp_filename)
30
+ filename = tmp_filename
31
+ else:
32
+ self.temp_dir = None
33
+ in_use.append(filename)
34
+ self.filename = str(filename)
35
+ self.cdecl = cdecl
36
+ self.open()
37
+ atexit.register(self.close)
38
+
39
+ @staticmethod
40
+ def find_dll(path, name):
41
+ p = Path(path)
42
+
43
+ # if sys.platform == "win32":
44
+ # prefixes = ['']
45
+ # if sys.maxsize > 2**32:
46
+ # suffixes = ['.dll', '_64.dll']
47
+ # else:
48
+ # suffixes = ['.dll']
49
+ # elif sys.platform == 'linux':
50
+ # prefixes = ['lib','']
51
+ # suffixes = ['.so']
52
+ # else:
53
+ # raise NotImplementedError()
54
+
55
+ dll_lst = []
56
+ file_patterns = ['*%s*.dll' % name, '*%s*.so' % name]
57
+ for fp in file_patterns:
58
+ dll_lst.extend(list(p.glob("**/" + fp)))
59
+
60
+ def use_first(dll_lst):
61
+ f = str(dll_lst[0])
62
+ print("Using ", os.path.abspath(f))
63
+ return DLLWrapper(f)
64
+
65
+ if len(dll_lst) == 1:
66
+ return use_first(dll_lst)
67
+ elif len(dll_lst) > 1:
68
+ # check if excluding dlls in hawc2-binary, i.e. "hawc2-<platform>" results in one dll
69
+ dll_lst2 = [d for d in dll_lst if not str(d).startswith('hawc2-')]
70
+ if len(dll_lst2) == 1:
71
+ return use_first(dll_lst2)
72
+ raise FileExistsError("Multiple dlls found:\n" + "\n".join([str(p) for p in dll_lst]))
73
+ else:
74
+ raise FileNotFoundError("No " + " or ".join(file_patterns) +
75
+ " files found in " + os.path.abspath(p.absolute()))
76
+
77
+ def open(self):
78
+ assert os.path.isfile(self.filename), os.path.abspath(self.filename)
79
+ if self.cdecl:
80
+ if tuple(map(int,platform.python_version().split('.'))) < (3,8):
81
+ self.lib = ct.CDLL(self.filename)
82
+ else:
83
+ self.lib = ct.CDLL(self.filename, winmode=ctypes.DEFAULT_MODE)
84
+ else:
85
+ self.lib = windll.LoadLibrary(self.filename)
86
+
87
+ def close(self):
88
+ if "FreeLibrary" in dir(_ctypes):
89
+ _ctypes.FreeLibrary(self.lib._handle)
90
+ else:
91
+ _ctypes.dlclose(self.lib._handle)
92
+ atexit.unregister(self.close)
93
+ in_use.remove(self.filename)
94
+ if self.temp_dir:
95
+ self.temp_dir.cleanup()
96
+
97
+ # def __enter__(self):
98
+ # self.open()
99
+ # return self
100
+ #
101
+ # def __exit__(self, type, value, traceback):
102
+ # self.close()
103
+ # return False
104
+
105
+ def __getattribute__(self, name):
106
+ try:
107
+ return object.__getattribute__(self, name)
108
+ except AttributeError:
109
+ if name == 'lib':
110
+ raise Exception("DLL not loaded. Run using: 'with dll: ...'")
111
+ return self.get_lib_function(name)
112
+
113
+ def get_lib_function(self, name):
114
+ try:
115
+ f = getattr(self.lib, name)
116
+ except AttributeError as e:
117
+ raise AttributeError("Attribute '%s' not found in dll ('%s')" % (name, self.filename))
118
+
119
+ def wrap(*args, **kwargs):
120
+ c_args = []
121
+ for arg in args:
122
+ if isinstance(arg, int):
123
+ c_args.append(c_int_p(c_int(arg)))
124
+ elif isinstance(arg, float):
125
+ c_args.append(c_double_p(c_double(arg)))
126
+ elif isinstance(arg, str):
127
+ c_args.append(c_char_p(arg.encode('cp1252')))
128
+ # c_args.append(c_int_p(c_int(len(arg))))
129
+
130
+ elif isinstance(arg, np.ndarray):
131
+ if arg.dtype == int:
132
+ c_args.append(arg.ctypes.data_as(c_int_p))
133
+ elif arg.dtype == np.float64:
134
+ c_args.append(arg.ctypes.data_as(c_double_p))
135
+ else:
136
+ raise NotImplementedError(arg.dtype)
137
+
138
+ else:
139
+ # raise NotImplementedError(arg.__class__.__name__)
140
+ c_args.append(arg)
141
+ if 'restype' in kwargs:
142
+ restype = kwargs['restype']
143
+ if hasattr(restype, 'dtype'):
144
+ restype = np.ctypeslib.as_ctypes_type(restype)
145
+ f.restype = restype
146
+
147
+ res = f(*c_args)
148
+ ret_args = []
149
+ for arg in args:
150
+ c_arg = c_args.pop(0)
151
+ if isinstance(arg, (int, float)):
152
+ ret_args.append(c_arg.contents.value)
153
+ elif isinstance(arg, (str)):
154
+ ret_args.append(c_arg.value.decode('cp1252'))
155
+ # c_args.pop(0)
156
+ elif isinstance(arg, np.ndarray):
157
+ ret_args.append(arg)
158
+ else:
159
+ raise NotImplementedError(arg.__class__.__name__)
160
+ return ret_args, res
161
+ return wrap
162
+
163
+ def version(self, function_name='get_version'):
164
+ try:
165
+ f = getattr(self.lib, function_name)
166
+ f.argtypes = [c_char_p, c_long]
167
+ s = "".ljust(255)
168
+ arg = c_char_p(s.encode('utf-8'))
169
+ f(arg, len(s))
170
+ return arg.value.decode().strip()
171
+ except AttributeError:
172
+ if function_name == 'get_version':
173
+ return self.version('version')
174
+
175
+ def getFileProperties(self):
176
+ if sys.platform != "win32":
177
+ raise OSError("Only supported for Windows")
178
+ import win32api
179
+ fname = self.filename
180
+
181
+ # ==============================================================================
182
+ """
183
+ Read all properties of the given file return them as a dictionary.
184
+ """
185
+ propNames = ('Comments', 'InternalName', 'ProductName',
186
+ 'CompanyName', 'LegalCopyright', 'ProductVersion',
187
+ 'FileDescription', 'LegalTrademarks', 'PrivateBuild',
188
+ 'FileVersion', 'OriginalFilename', 'SpecialBuild')
189
+
190
+ props = {'FixedFileInfo': None, 'StringFileInfo': None, 'FileVersion': None}
191
+
192
+ try:
193
+ # backslash as parm returns dictionary of numeric info corresponding to VS_FIXEDFILEINFO struc
194
+ fixedInfo = win32api.GetFileVersionInfo(fname, '\\')
195
+ props['FixedFileInfo'] = fixedInfo
196
+ props['FileVersion'] = "%d.%d.%d.%d" % (fixedInfo['FileVersionMS'] / 65536,
197
+ fixedInfo['FileVersionMS'] % 65536, fixedInfo['FileVersionLS'] / 65536,
198
+ fixedInfo['FileVersionLS'] % 65536)
199
+
200
+ # \VarFileInfo\Translation returns list of available (language, codepage)
201
+ # pairs that can be used to retreive string info. We are using only the first pair.
202
+ lang, codepage = win32api.GetFileVersionInfo(fname, '\\VarFileInfo\\Translation')[0]
203
+
204
+ # any other must be of the form \StringfileInfo\%04X%04X\parm_name, middle
205
+ # two are language/codepage pair returned from above
206
+
207
+ strInfo = {}
208
+ for propName in propNames:
209
+ strInfoPath = u'\\StringFileInfo\\%04X%04X\\%s' % (lang, codepage, propName)
210
+ # print str_info
211
+ strInfo[propName] = win32api.GetFileVersionInfo(fname, strInfoPath)
212
+
213
+ props['StringFileInfo'] = strInfo
214
+ except BaseException:
215
+ pass
216
+
217
+ return props
218
+
219
+
220
+ class Type2DllWrapper(DLLWrapper):
221
+ def __init__(self, filename, dll_subroutine_init, dll_subroutine_update,
222
+ arraysizes_init, arraysizes_update,
223
+ init_array):
224
+ super().__init__(filename)
225
+ self.dll_subroutine_init = dll_subroutine_init
226
+ self.dll_subroutine_update = dll_subroutine_update
227
+ self.arraysizes_init = arraysizes_init
228
+ self.arraysizes_update = arraysizes_update
229
+ self.init_array = init_array
230
+
231
+ def open(self):
232
+ DLLWrapper.open(self)
233
+ self.init()
234
+
235
+ def call(self, name, array, n1, n2):
236
+ f = getattr(self.lib, name)
237
+ f.argtypes = [ndpointer(shape=n1, dtype=ct.c_double, flags='FORTRAN'),
238
+ ndpointer(shape=n2, dtype=ct.c_double, flags='FORTRAN')]
239
+ f.restype = None
240
+
241
+ pad_array = np.zeros(n1)
242
+ pad_array[:len(array)] = array
243
+ arg1 = np.array(pad_array, dtype=ct.c_double, order='F')
244
+ arg2 = np.zeros(n2, dtype=ct.c_double, order='F')
245
+
246
+ f(arg1, arg2)
247
+ return(arg2)
248
+
249
+ def init(self):
250
+ n1, n2 = self.arraysizes_init
251
+ return self.call(self.dll_subroutine_init, self.init_array, n1, n2)
252
+
253
+ def update(self, array):
254
+ n1, n2 = self.arraysizes_update
255
+ return self.call(self.dll_subroutine_update, array, n1, n2)
@@ -0,0 +1,100 @@
1
+ from h2lib.dll_wrapper import DLLWrapper
2
+ class H2LibSignatures():
3
+ def echo_version(self, ):
4
+ '''subroutine echo_version() bind(c, name='echo_version')
5
+ ! end subroutine'''
6
+ return self.get_lib_function('echo_version')()
7
+
8
+ def getSquare(self, val, restype):
9
+ '''function getsquare(val) result(valsquared) bind(c, name='getsquare')
10
+ !dec$ attributes dllexport :: getsquare
11
+ use, intrinsic :: iso_fortran_env, only: rk => real64
12
+ real(rk), intent(in) :: val
13
+ real(rk) :: valsquared
14
+ valsquared = val ** 2
15
+ end function'''
16
+ return self.get_lib_function('getSquare')(val, restype=restype)
17
+
18
+ def getState(self, restype):
19
+ '''function getstate() result(val) bind(c, name='getstate')
20
+ !dec$ attributes dllexport :: getstate
21
+ integer :: val
22
+ val = state
23
+ end function'''
24
+ return self.get_lib_function('getState')(restype=restype)
25
+
26
+ def get_version(self, s):
27
+ '''subroutine get_version(s) bind(c, name='get_version')
28
+ use iso_c_binding
29
+ implicit none
30
+ character(kind=c_char, len=1), intent(inout) :: s(255)
31
+ end subroutine'''
32
+ return self.get_lib_function('get_version')(s)
33
+
34
+ def setState(self, val):
35
+ '''subroutine setstate(val) bind(c, name='setstate')
36
+ !dec$ attributes dllexport :: setstate
37
+ integer, intent(in) :: val
38
+ state = val
39
+ end subroutine'''
40
+ return self.get_lib_function('setState')(val)
41
+
42
+ def sqr2(self, val):
43
+ '''subroutine sqr2(val) bind(c, name='sqr2')
44
+ !dec$ attributes dllexport :: sqr2
45
+ integer, intent(inout) :: val
46
+ val = val ** 2
47
+ end subroutine'''
48
+ return self.get_lib_function('sqr2')(val)
49
+
50
+ def test_hdf5(self, ):
51
+ '''subroutine test_hdf5() bind(c, name='test_hdf5')
52
+ !dec$ attributes dllexport :: test_hdf5
53
+ use hdf5
54
+ use iso_c_binding
55
+
56
+ integer :: hdferr ! error flag
57
+ character(9) :: filename = 'test.hdf5'
58
+ integer(hid_t) :: file_id ! file identifier
59
+ integer(hid_t) :: h5_create_file,h5_open_file ! file identifier
60
+ type(c_ptr) :: x
61
+
62
+ print *, "test hdf5"
63
+ print *, "system:", c_sizeof(x) * 8, 'bit'
64
+
65
+ print *, "create file"
66
+ call h5open_f(hdferr)
67
+ call h5fcreate_f(filename, h5f_acc_trunc_f, file_id, hdferr) !h5f_acc_trunc_f overwrite existing file
68
+ h5_create_file = file_id
69
+
70
+ print *, "open file"
71
+ call h5fopen_f(filename, h5f_acc_rdwr_f, file_id, hdferr)
72
+ h5_open_file = file_id
73
+
74
+ print *, "close file"
75
+ call h5fclose_f(file_id, hdferr)
76
+ call h5close_f(hdferr)
77
+
78
+ print *, "test succeeded"
79
+ end subroutine'''
80
+ return self.get_lib_function('test_hdf5')()
81
+
82
+ def test_mkl(self, ):
83
+ '''subroutine test_mkl() bind(c, name='test_mkl')
84
+ !dec$ attributes dllexport :: test_mkl
85
+ use mymkl
86
+ implicit none
87
+
88
+ ! variables
89
+
90
+ real(8),dimension(3)::t3, tt3
91
+ real(8),dimension(3,3)::t33
92
+
93
+ ! body of test_mkl
94
+ print *, 'hello world'
95
+
96
+
97
+ call dgemv('n',3,3,1.d0,t33,3,t3,1,0.d0,tt3,1)
98
+ print *, tt3
99
+ end subroutine'''
100
+ return self.get_lib_function('test_mkl')()
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: h2lib
3
- Version: 0.0.4
4
- Summary: Python interface to HAWC2
3
+ Version: 13.0.404
4
+ Summary: Python interface to HAWC2 (13.0.4+5-g5e498aa)
5
5
  Download-URL:
6
6
  Author: S.G.Horcas and N.G.Ramos
7
7
  Author-email:
8
8
  Maintainer:
9
9
  Maintainer-email:
10
- Requires-Dist: intel-fortran-rt ==2021.3.0
11
- Requires-Dist: mkl ==2021.3.0
12
10
  Requires-Dist: numpy
13
11
  Requires-Dist: pytest
12
+ Requires-Dist: intel-fortran-rt ==2021.3.0
13
+ Requires-Dist: mkl ==2021.3.0
14
14
 
@@ -0,0 +1,10 @@
1
+ h2lib/HAWC2Lib.dll,sha256=Z_ZG24v0RfQSlGz7NUNsuUNklhy4uAJYHqewsWP4c1w,29047296
2
+ h2lib/__init__.py,sha256=v4RtCtR7Cfv-LSx-9tnLK0WSefKVjIKrGjfBVBhONzI,27
3
+ h2lib/_h2lib.py,sha256=GBSryoz1g_FuPMk3zIKjVBmzq5JpQgLn1x7OZJXkzwY,801
4
+ h2lib/calc.py,sha256=eqPH_ruyWpnXVJDH8jVjuV3u-Dh_MiwSlgEV-hjDM_w,448
5
+ h2lib/dll_wrapper.py,sha256=pe6WKgIX4eDwROPwZROFM63a5cdnNnz0E68W-1T5YaA,9712
6
+ h2lib/h2lib_signatures.py,sha256=Kz7UrEA7yNMUi5sy6R7wUdClhvLAKNecAjq10WpB55k,3214
7
+ h2lib-13.0.404.dist-info/METADATA,sha256=FA9xI0sBY2yeHasEod3UzQuT_BxSJwkEq49YOzEAEOg,333
8
+ h2lib-13.0.404.dist-info/WHEEL,sha256=KplWMgwSZbeAOumvxNxIrVbNPnn_LVzfBH7l38jDCVM,100
9
+ h2lib-13.0.404.dist-info/top_level.txt,sha256=y_a-tUqphEZQ_0nsWSMaSb21P8Lsd8hUxUdE9g2Dcbk,6
10
+ h2lib-13.0.404.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.1)
2
+ Generator: bdist_wheel (0.41.2)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-cp38-win_amd64
5
5
 
Binary file
@@ -1,13 +0,0 @@
1
- from h2lib.dll_wrapper import DLLWrapper
2
- import os
3
-
4
-
5
- class H2Lib(DLLWrapper):
6
- def __init__(self, filename=None):
7
- if filename is None:
8
- if os.name == 'nt':
9
- filename = os.path.dirname(__file__) + '/TestLib.dll'
10
- else:
11
- filename = os.path.dirname(__file__) + '/TestLib.so'
12
-
13
- DLLWrapper.__init__(self, filename, cdecl=True)
@@ -1,9 +0,0 @@
1
- h2lib-0.0.4.data/purelib/h2lib/TestLib.dll,sha256=iRgC1hyKxjIoAoh4FruOU0Q78Gplh9BgxNOII00_9Q8,2859008
2
- h2lib-0.0.4.data/purelib/h2lib/__init__.py,sha256=v4RtCtR7Cfv-LSx-9tnLK0WSefKVjIKrGjfBVBhONzI,27
3
- h2lib-0.0.4.data/purelib/h2lib/_h2lib.py,sha256=tapiHobRD2T7jZhizOHCW9uX2sGjkDWMa-Na9oIBcYE,417
4
- h2lib-0.0.4.data/purelib/h2lib/calc.py,sha256=eqPH_ruyWpnXVJDH8jVjuV3u-Dh_MiwSlgEV-hjDM_w,448
5
- h2lib-0.0.4.data/purelib/h2lib/dll_wrapper.py,sha256=KWbqOu42EtO2WeP8T6ne5aYOEszs9QoheaKDbYS8JAQ,8903
6
- h2lib-0.0.4.dist-info/METADATA,sha256=hACt34y2BAVpm3ZM6meuatN9gy6trlEFq0kTtrZkCFQ,310
7
- h2lib-0.0.4.dist-info/WHEEL,sha256=ubKCG5XSDI8ZG5iAwgsAU4yUktRq9BG9Pse4izScbq0,100
8
- h2lib-0.0.4.dist-info/top_level.txt,sha256=y_a-tUqphEZQ_0nsWSMaSb21P8Lsd8hUxUdE9g2Dcbk,6
9
- h2lib-0.0.4.dist-info/RECORD,,
File without changes
File without changes