From 40d46b06428661358c817352a833f5571a5b2714 Mon Sep 17 00:00:00 2001
From: mmpe <mmpe@dtu.dk>
Date: Wed, 13 Jan 2021 07:26:26 +0100
Subject: [PATCH] add default value of yaw, to avoid error in PyWakePark

---
 py_wake/wind_turbines.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/py_wake/wind_turbines.py b/py_wake/wind_turbines.py
index f3cb52e31..4d80b7a07 100644
--- a/py_wake/wind_turbines.py
+++ b/py_wake/wind_turbines.py
@@ -465,17 +465,17 @@ class YawModel():
     def __init__(self, func):
         self.func = func
 
-    def __call__(self, ws, yaw):
-        return self.func(np.cos(yaw) * ws)
+    def __call__(self, ws, yaw=0):
+        return self.func(np.cos(yaw) * np.asarray(ws))
 
 
 class CTYawModel(YawModel):
-    def __call__(self, ws, yaw):
+    def __call__(self, ws, yaw=0):
         # ct_n = ct_curve(cos(yaw)*ws)*cos^2(yaw)
         # mapping to downwind deficit, i.e. ct_x = ct_n*cos(yaw) = ct_curve(cos(yaw)*ws)*cos^3(yaw),
         # handled in deficit model
         co = np.cos(yaw)
-        return self.func(co * ws) * co**2
+        return self.func(co * np.asarray(ws)) * co**2
 
 
 class Interp(object):
-- 
GitLab