diff --git a/pyproject.toml b/pyproject.toml index cc23a3eb..96b3c0cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rosco" -version = "2.9.5" +version = "2.9.6" description = "A reference open source controller toolset for wind turbine applications." readme = "README.md" requires-python = ">=3.9" diff --git a/rosco/toolbox/control_interface.py b/rosco/toolbox/control_interface.py index 0e81157e..c0ea977c 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 bafe84bf..9eff7829 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 2262f10e..4b946443 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]])