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

changed docker file to apt-get install lazarus

parent 91c1b125
No related branches found
No related tags found
1 merge request!94Handle disabled mpi
......@@ -56,6 +56,14 @@ ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$IPOPT_DIR/lib
## Install PyOptSparse
#COPY docker/install_pyoptsparse.sh /install
WORKDIR $POSDIR
# Replace python 3 incomplatible files from pyoptsparse with files from pyipopt
RUN git clone https://github.com/xuy/pyipopt.git && \
mv ./pyipopt/src/pyipoptcoremodule.c ./pyoptsparse/pyIPOPT/src/pyipoptcoremodule.c && \
mv ./pyipopt/src/hook.h ./pyoptsparse/pyIPOPT/src/hook.h && \
mv ./pyipopt/src/callback.c ./pyoptsparse/pyIPOPT/src/callback.c
RUN python setup.py install
#RUN mkdir /notebooks
......@@ -74,14 +82,16 @@ RUN chmod +x /usr/bin/tini
# Install the Colonel
RUN mkdir /deb
WORKDIR /deb
COPY docker/*.deb /deb/
RUN dpkg -i *.deb
#RUN mkdir /deb
#WORKDIR /deb
#COPY docker/*.deb /deb/
#RUN dpkg -i *.deb
RUN apt-get clean \
&& apt-get autoremove -y
RUN apt-get install lazarus -y
#RUN mkdir /install
#RUN mkdir /install/source
#RUN mkdir /install/FugaLib
......@@ -91,10 +101,10 @@ RUN apt-get clean \
#COPY topfarm/cost_models/fuga/Colonel/FugaLib/FugaLib.lpi /install/FugaLib
## Build
#RUN lazbuild /install/FugaLib/FugaLib.lpr
RUN lazbuild /install/FugaLib/FugaLib.lpi
#RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
#RUN apt-get update -y && apt-get install -y nodejs
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update -y && apt-get install -y nodejs
#RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager \
......
File deleted
File deleted
......@@ -22,8 +22,8 @@ desired = [[3, -3], [7, -7], [4, -3]] # desired turbine layouts
@pytest.fixture
def topfarm_generator():
def _topfarm_obj(driver):
plot_comp = DummyCostPlotComp(desired)
#plot_comp = NoPlot()
#plot_comp = DummyCostPlotComp(desired)
plot_comp = NoPlot()
return TopFarm(initial, DummyCost(desired), 2, plot_comp=plot_comp, boundary=boundary, driver=driver)
return _topfarm_obj
......@@ -57,17 +57,19 @@ def topfarm_generator():
@pytest.mark.parametrize('driver,tol',[(EasyScipyOptimizeDriver(), 1e-4),
(EasyScipyOptimizeDriver(tol=1e-3), 1e-2),
(EasyScipyOptimizeDriver(maxiter=13), 1e-1),
#(EasyScipyOptimizeDriver(tol=1e-3), 1e-2),
#(EasyScipyOptimizeDriver(maxiter=13), 1e-1),
(EasyScipyOptimizeDriver(optimizer='COBYLA', tol=1e-3), 1e-2),
(EasyPyOptSparseSLSQP(),1e-4),
#(EasyPyOptSparseSLSQP(),1e-4),
(EasyPyOptSparseIPOPT(),1e-4),
#(EasySimpleGADriver(), 1e-4)
][-1:])
][:])
def test_optimizers(driver, tol, topfarm_generator):
if isinstance(driver, str):
pytest.xfail("reason")
tf = topfarm_generator(driver)
tf.evaluate()
print (driver.__class__.__name__)
tf.optimize()
tb_pos = tf.turbine_positions
#tf.plot_comp.show()
......
......@@ -30,12 +30,13 @@ try:
def __init__(self, maxit=200, acc=1e-6):
pyOptSparseDriver.__init__(self)
self.options.update({'optimizer': 'SLSQP'})
self.opt_settings.update({'maxit': maxit, 'acc': acc})
#self.opt_settings.update({'maxit': maxit, 'acc': acc})
class EasyPyOptSparseIPOPT(pyOptSparseDriver):
def __init__(self):
def __init__(self, max_iter=200):
pyOptSparseDriver.__init__(self)
self.options.update({'optimizer': 'IPOPT'})
self.opt_settings.update({'linear_solver': 'ma27', 'max_iter': max_iter})
except:
......
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