Commit 8d055c23 authored by Jenni Rinker's avatar Jenni Rinker

remove test dependency on gen_turb

parent 11844a5c
......@@ -7,7 +7,7 @@ import numpy as np
import pandas as pd
import pytest
from pyconturb import TimeConstraint, gen_turb
from pyconturb import TimeConstraint
import pyconturb._utils as utils
......@@ -17,21 +17,16 @@ _spat_rownames = utils._spat_rownames
def test_check_sims_collocated():
"""verify function works when no unique simulation points"""
# given -- constraining points
spat_arr = [[0, 0, 0, 70], [1, 0, 0, 70], [2, 0, 0, 70]]
con_arr = np.array([[0, 0, 0, 70, 1], [1, 0, 0, 70, 1], [2, 0, 0, 70, 1]]).T
kwargs = {'u_ref': 10, 'turb_class': 'B', 'l_c': 340.2, 'z_ref': 70, 'T': 300,
'dt': 0.5, 'seed': 1337}
inp_out = [(0, 1, False), (0, 2, True)]
# given -- points to simulate
spat_df = pd.DataFrame([[0, 0, 0, 70],
[1, 0, 0, 70]], columns=_spat_rownames).T
for (start, stop, res_theo) in inp_out:
con_spat_df = pd.DataFrame(spat_arr[start:stop],
columns=_spat_rownames).T
coh_model = 'iec'
con_turb_df = gen_turb(con_spat_df, coh_model=coh_model, **kwargs)
con_tc = TimeConstraint().from_con_data(con_spat_df=con_spat_df.T, con_turb_df=con_turb_df)
# given -- simulated, constrainted turbulence
spat_df = pd.DataFrame([[0, 0, 0, 70],
[1, 0, 0, 70]], columns=_spat_rownames).T
# given -- constraint
con_tc = TimeConstraint(con_arr[:, start:stop], index=_spat_rownames + [0])
# when
res = utils.check_sims_collocated(spat_df, con_tc)
# then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment