From 76f23eefb0fa86d0c0cea28636d69f8619fefd6c Mon Sep 17 00:00:00 2001 From: Garrett Barter Date: Tue, 22 Oct 2024 20:43:33 -0600 Subject: [PATCH 1/2] fixes for nump2 and newer windows gfortran --- rosco/toolbox/control_interface.py | 2 ++ rosco/toolbox/ofTools/fast_io/output_processing.py | 2 +- rosco/toolbox/ofTools/util/FileTools.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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]]) From 38d9858ec5cc1fafa8eb68e7049ea047eac33d23 Mon Sep 17 00:00:00 2001 From: dzalkind <65573423+dzalkind@users.noreply.github.com> Date: Fri, 3 Jan 2025 10:13:48 -0700 Subject: [PATCH 2/2] Increment ROSCO version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"