Skip to content
Snippets Groups Projects
Commit 2bbb5f4c authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

close plots after test

parent 5e8d58b2
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,15 @@ k = [2.392578, 2.447266, 2.412109, 2.591797, 2.755859, 2.595703, ...@@ -16,6 +16,15 @@ k = [2.392578, 2.447266, 2.412109, 2.591797, 2.755859, 2.595703,
ti = .1 ti = .1
@pytest.fixture(autouse=True)
def close_plots():
yield
try:
plt.close()
except Exception:
pass
@pytest.fixture @pytest.fixture
def site(): def site():
return UniformWeibullSite(f, A, k, ti, shear=PowerShear(50, alpha=np.zeros_like(f) + .3)) return UniformWeibullSite(f, A, k, ti, shear=PowerShear(50, alpha=np.zeros_like(f) + .3))
......
...@@ -16,6 +16,15 @@ from py_wake.tests.check_speed import timeit ...@@ -16,6 +16,15 @@ from py_wake.tests.check_speed import timeit
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
@pytest.fixture(autouse=True)
def close_plots():
yield
try:
plt.close()
except Exception:
pass
@pytest.fixture @pytest.fixture
def site(): def site():
return ParqueFicticioSite() return ParqueFicticioSite()
......
...@@ -27,6 +27,15 @@ k = [2.392578, 2.447266, 2.412109, 2.591797, 2.755859, 2.595703, ...@@ -27,6 +27,15 @@ k = [2.392578, 2.447266, 2.412109, 2.591797, 2.755859, 2.595703,
ti = .1 ti = .1
@pytest.fixture(autouse=True)
def close_plots():
yield
try:
plt.close()
except Exception:
pass
@pytest.fixture @pytest.fixture
def uniform_site(): def uniform_site():
ti = 0.1 ti = 0.1
......
...@@ -272,6 +272,7 @@ class EngineeringWindFarmModel(WindFarmModel): ...@@ -272,6 +272,7 @@ class EngineeringWindFarmModel(WindFarmModel):
add_turb_ijk = self.turbulenceModel.calc_added_turbulence(dw_ijlk=dw_ijlk, **args)[:, :, 0] add_turb_ijk = self.turbulenceModel.calc_added_turbulence(dw_ijlk=dw_ijlk, **args)[:, :, 0]
l_ = [l, 0][lw_j.WS_ilk.shape[1] == 1] l_ = [l, 0][lw_j.WS_ilk.shape[1] == 1]
assert lw_j.WS_ilk.shape[1] == dh_ijl.shape[2] == hcw_ijlk.shape[2]
if isinstance(self.superpositionModel, WeightedSum): if isinstance(self.superpositionModel, WeightedSum):
cw_ijk = np.hypot(dh_ijl[..., na], hcw_ijlk)[:, :, l_] cw_ijk = np.hypot(dh_ijl[..., na], hcw_ijlk)[:, :, l_]
hcw_ijk, dh_ijk = hcw_ijlk[:, :, l_], dh_ijl[:, :, l_, na] hcw_ijk, dh_ijk = hcw_ijlk[:, :, l_], dh_ijl[:, :, l_, na]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment