diff --git a/rosco/toolbox/control_interface.py b/rosco/toolbox/control_interface.py index 96c942b37..f8b7e1110 100644 --- a/rosco/toolbox/control_interface.py +++ b/rosco/toolbox/control_interface.py @@ -20,6 +20,7 @@ create_string_buffer, c_int32, c_void_p, + wintypes, ) import numpy as np import platform @@ -258,6 +259,7 @@ def null_free_dll(*spam): # pragma: no cover if OS == "Windows": # pragma: Windows try: + ctypes.windll.kernel32.FreeLibrary.argtypes = [wintypes.HMODULE] _dlclose = ctypes.windll.kernel32.FreeLibrary dlclose = lambda handle: 0 if _dlclose(handle) else 1 except: diff --git a/rosco/toolbox/ofTools/fast_io/output_processing.py b/rosco/toolbox/ofTools/fast_io/output_processing.py index bafe84bff..9eff7829d 100644 --- a/rosco/toolbox/ofTools/fast_io/output_processing.py +++ b/rosco/toolbox/ofTools/fast_io/output_processing.py @@ -366,7 +366,7 @@ def load_ascii_output(filename): info['attribute_units'] = [unit[1:-1] for unit in f.readline().split()] # Data, up to end of file or empty line (potential comment line at the end) - data = np.array([l.strip().split() for l in takewhile(lambda x: len(x.strip())>0, f.readlines())]).astype(np.float_) + data = np.array([l.strip().split() for l in takewhile(lambda x: len(x.strip())>0, f.readlines())]).astype(np.float64) return data, info diff --git a/rosco/toolbox/ofTools/util/FileTools.py b/rosco/toolbox/ofTools/util/FileTools.py index 2262f10e4..4b9464432 100644 --- a/rosco/toolbox/ofTools/util/FileTools.py +++ b/rosco/toolbox/ofTools/util/FileTools.py @@ -32,7 +32,7 @@ def loop_dict(vartree, branch): if data_type in [np.int_, np.intc, np.intp, np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64]: get_dict(fst_vt, branch_i[:-1])[branch_i[-1]] = int(get_dict(fst_vt, branch_i[:-1])[branch_i[-1]]) - elif data_type in [np.single, np.double, np.longdouble, np.csingle, np.cdouble, np.float_, np.float16, np.float32, np.float64, np.complex64, np.complex128]: + elif data_type in [np.single, np.double, np.longdouble, np.csingle, np.cdouble, np.float16, np.float32, np.float64, np.complex64, np.complex128]: get_dict(fst_vt, branch_i[:-1])[branch_i[-1]] = float(get_dict(fst_vt, branch_i[:-1])[branch_i[-1]]) elif data_type in [np.bool_]: get_dict(fst_vt, branch_i[:-1])[branch_i[-1]] = bool(get_dict(fst_vt, branch_i[:-1])[branch_i[-1]])