Skip to content

Commit

Permalink
fixes for nump2 and newer windows gfortran (#412)
Browse files Browse the repository at this point in the history
* fixes for nump2 and newer windows gfortran

* Increment ROSCO version

---------

Co-authored-by: Garrett Barter <[email protected]>
  • Loading branch information
dzalkind and gbarter authored Jan 3, 2025
1 parent fcc4394 commit 975ffac
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions rosco/toolbox/control_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
create_string_buffer,
c_int32,
c_void_p,
wintypes,
)
import numpy as np
import platform
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion rosco/toolbox/ofTools/fast_io/output_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion rosco/toolbox/ofTools/util/FileTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]])
Expand Down

0 comments on commit 975ffac

Please sign in to comment.