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

Merge branch 'new_ci_image' into 'master'

New ci image

See merge request !40
parents 3280af6f 756b16f4
No related branches found
No related tags found
1 merge request!40New ci image
Pipeline #
# ===== DEFINE DEFAULT DOCKER IMAGE =====
# dockerhub image generated using docker/Dockerfile_simple
image: rinkdtu/topfarm-ci:latest
image: dtuwindenergy/topfarm2:latest
# ===== TEST TOPFARM =====
......
......@@ -25,5 +25,5 @@ RUN conda update -y conda && \
# update pip then install openmdao, windio and fused-wake (nocache to save space)
RUN pip install --upgrade pip && \
pip install --no-cache-dir openmdao && \
pip install --no-cache-dir git+https://github.com/rethore/windIO.git && \
pip install --no-cache-dir git+https://github.com/FUSED-Wind/FUSED-Wake.git
pip install --no-cache-dir git+https://github.com/FUSED-Wind/windIO.git && \
pip install --no-cache-dir git+https://gitlab.windenergy.dtu.dk/TOPFARM/FUSED-Wake.git
......@@ -100,7 +100,7 @@ class TopFarm(object):
if comp._has_compute_partials and
(comp.pathname not in ['spacing_comp', 'bound_comp', 'plot_comp'] or (all and comp.pathname != 'plot_comp'))]
print("checking %s" % ", ".join(comp_name_lst))
res = self.problem.check_partials(comps=comp_name_lst, compact_print=True)
res = self.problem.check_partials(includes=comp_name_lst, compact_print=True)
for comp in comp_name_lst:
var_pair = list(res[comp].keys())
worst = var_pair[np.argmax([res[comp][k]['rel error'].forward for k in var_pair])]
......@@ -180,7 +180,7 @@ def try_me():
boundary = [(0, 0), (6, 0), (6, -10), (0, -10)]
tf = TopFarm(optimal, DummyCost(optimal), minSpacing * rotorDiameter,
boundary=boundary, plot_comp=plot_comp)
boundary=boundary, plot_comp=plot_comp, record=True)
# tf.check()
tf.shuffle_positions(shuffle_type='abs', offset=random_offset)
tf.optimize()
......
......@@ -8,10 +8,10 @@ import os
from topfarm.utils import pos_from_case, latest_id, _shuffle_positions_abs
thisdir = os.path.dirname(os.path.abspath(__file__))
turbines = np.array([[ 2.4999377 , -2.99987763],
[ 6. , -6.99997496],
[ 4.49993771, -2.99985273],
[ 3.00004123, -6.9999519 ]])
turbines = np.array([[ 2.49998371, -2.99999965],
[ 6. , -6.99999467],
[ 4.49998371, -3.00002279],
[ 3.00001007, -7.00001197]])
x = np.array([-0.5463264 , 0.4158521 , 1.50479727, 3.04121982, 0.82494571,
1.48072571, 0.03939927, 2.27593243, -0.18551361, 0.24885285,
1.12706339, 2.25472924, 0.04329133, 0.292686 , 5.18916103,
......@@ -47,7 +47,7 @@ turbines2_ref = np.array([[-0.53056298, -5.34414632],
[ 6.42858562, -9.90795045]])
def testpos_from_case():
crf = "../test_files/recordings/cases_20180621_111710.sql"
crf = "../test_files/recordings/cases_20180703_152607.sql"
path = os.path.join(thisdir, crf)
np.testing.assert_allclose(turbines, pos_from_case(path))
......@@ -55,7 +55,7 @@ def testpos_from_case():
def testlatest_id():
crd = "../test_files/recordings"
path = os.path.join(thisdir, crd)
ref_path = os.path.join(path,'cases_20180621_111710.sql')
ref_path = os.path.join(path,'cases_20180703_152607.sql')
assert latest_id(path) == ref_path
def test_shuffle_positions_abs():
......
......@@ -17,12 +17,10 @@ def pos_from_case(case_recorder_filename):
string += case_recorder_filename
raise Warning(string)
cr = CaseReader(case_recorder_filename)
case_list = cr.driver_cases.list_cases()
case_len = len(case_list)
case_arg = 'rank0:SLSQP|{:d}'.format(case_len-1)
case = cr.driver_cases.get_case(case_arg)
x = np.array(case.desvars['turbineX'])
y = np.array(case.desvars['turbineY'])
driver_case = cr.driver_cases.get_case(-1)
desvars = driver_case.get_desvars()
x = np.array(desvars['turbineX'])
y = np.array(desvars['turbineY'])
turbines = np.column_stack((x, y))
return turbines
......@@ -145,7 +143,7 @@ def _move_inside_boundary(n_wt, turbineX, turbineY, boundary_comp, pad):
if __name__ == '__main__':
this_dir = os.getcwd()
crf = r"tests\test_files\recordings\cases_20180621_111710.sql"
crf = r"tests\test_files\recordings\cases_20180703_152607.sql"
case_recorder_filename = crf
path = os.path.join(this_dir, crf)
turbines = pos_from_case(path)
......
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