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

commit test_drivers.py

parent b8f97608
No related branches found
No related tags found
1 merge request!94Handle disabled mpi
...@@ -67,9 +67,9 @@ RUN python setup.py install ...@@ -67,9 +67,9 @@ RUN python setup.py install
# Add Tini. Tini operates as a process subreaper for jupyter. This prevents # Add Tini. Tini operates as a process subreaper for jupyter. This prevents
# kernel crashes. # kernel crashes.
#ENV TINI_VERSION v0.6.0 ENV TINI_VERSION v0.6.0
#ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
#RUN chmod +x /usr/bin/tini RUN chmod +x /usr/bin/tini
# Install the Colonel # Install the Colonel
...@@ -83,15 +83,15 @@ RUN apt-get clean \ ...@@ -83,15 +83,15 @@ RUN apt-get clean \
&& apt-get autoremove -y && apt-get autoremove -y
#RUN mkdir /install #RUN mkdir /install
RUN mkdir /install/source #RUN mkdir /install/source
RUN mkdir /install/FugaLib #RUN mkdir /install/FugaLib
WORKDIR /install #WORKDIR /install
COPY topfarm/cost_models/fuga/Colonel/source/*.pas /install/source/ #COPY topfarm/cost_models/fuga/Colonel/source/*.pas /install/source/
COPY topfarm/cost_models/fuga/Colonel/FugaLib/FugaLib.lpr /install/FugaLib/ #COPY topfarm/cost_models/fuga/Colonel/FugaLib/FugaLib.lpr /install/FugaLib/
COPY topfarm/cost_models/fuga/Colonel/FugaLib/FugaLib.lpi /install/FugaLib #COPY topfarm/cost_models/fuga/Colonel/FugaLib/FugaLib.lpi /install/FugaLib
## Build ## Build
RUN lazbuild /install/FugaLib/FugaLib.lpr #RUN lazbuild /install/FugaLib/FugaLib.lpr
#RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - #RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
#RUN apt-get update -y && apt-get install -y nodejs #RUN apt-get update -y && apt-get install -y nodejs
......
...@@ -9,7 +9,8 @@ import numpy as np ...@@ -9,7 +9,8 @@ import numpy as np
import pytest import pytest
from topfarm.cost_models.dummy import DummyCost, DummyCostPlotComp from topfarm.cost_models.dummy import DummyCost, DummyCostPlotComp
from topfarm.plotting import NoPlot from topfarm.plotting import NoPlot
from topfarm.easy_drivers import EasyScipyOptimizeDriver, EasySimpleGADriver from topfarm.easy_drivers import EasyScipyOptimizeDriver, EasySimpleGADriver,\
EasyPyOptSparseSLSQP, EasyPyOptSparseIPOPT
initial = [[6, 0], [6, -8], [1, 1]] # initial turbine layouts initial = [[6, 0], [6, -8], [1, 1]] # initial turbine layouts
...@@ -59,9 +60,13 @@ def topfarm_generator(): ...@@ -59,9 +60,13 @@ def topfarm_generator():
(EasyScipyOptimizeDriver(tol=1e-3), 1e-2), (EasyScipyOptimizeDriver(tol=1e-3), 1e-2),
(EasyScipyOptimizeDriver(maxiter=13), 1e-1), (EasyScipyOptimizeDriver(maxiter=13), 1e-1),
(EasyScipyOptimizeDriver(optimizer='COBYLA', tol=1e-3), 1e-2), (EasyScipyOptimizeDriver(optimizer='COBYLA', tol=1e-3), 1e-2),
#(EasyPyOptSparseSLSQP(),??), (EasyPyOptSparseSLSQP(),1e-4),
(EasySimpleGADriver(), 1e-4)][-1:]) (EasyPyOptSparseIPOPT(),1e-4),
#(EasySimpleGADriver(), 1e-4)
][-1:])
def test_optimizers(driver, tol, topfarm_generator): def test_optimizers(driver, tol, topfarm_generator):
if isinstance(driver, str):
pytest.xfail("reason")
tf = topfarm_generator(driver) tf = topfarm_generator(driver)
tf.optimize() tf.optimize()
tb_pos = tf.turbine_positions tb_pos = tf.turbine_positions
......
'''
Created on 17. maj 2018
@author: mmpe
'''
from topfarm import TopFarm from topfarm import TopFarm
import numpy as np import numpy as np
......
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