Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
TopFarm2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TOPFARM
TopFarm2
Commits
91c1b125
Commit
91c1b125
authored
6 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
commit test_drivers.py
parent
b8f97608
No related branches found
No related tags found
1 merge request
!94
Handle disabled mpi
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docker/Dockerfile
+10
-10
10 additions, 10 deletions
docker/Dockerfile
tests/topfarm/test_drivers.py
+8
-3
8 additions, 3 deletions
tests/topfarm/test_drivers.py
tests/topfarm/test_topfarm.py
+0
-5
0 additions, 5 deletions
tests/topfarm/test_topfarm.py
with
18 additions
and
18 deletions
docker/Dockerfile
+
10
−
10
View file @
91c1b125
...
...
@@ -67,9 +67,9 @@ RUN python setup.py install
# Add Tini. Tini operates as a process subreaper for jupyter. This prevents
# kernel crashes.
#
ENV TINI_VERSION v0.6.0
#
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
#
RUN chmod +x /usr/bin/tini
ENV
TINI_VERSION v0.6.0
ADD
https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN
chmod
+x /usr/bin/tini
# Install the Colonel
...
...
@@ -83,15 +83,15 @@ RUN apt-get clean \
&&
apt-get autoremove
-y
#RUN mkdir /install
RUN
mkdir
/install/source
RUN
mkdir
/install/FugaLib
WORKDIR
/install
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.lpi /install/FugaLib
#
RUN mkdir /install/source
#
RUN mkdir /install/FugaLib
#
WORKDIR /install
#
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.lpi /install/FugaLib
## 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 apt-get update -y && apt-get install -y nodejs
...
...
This diff is collapsed.
Click to expand it.
tests/topfarm/test_drivers.py
+
8
−
3
View file @
91c1b125
...
...
@@ -9,7 +9,8 @@ import numpy as np
import
pytest
from
topfarm.cost_models.dummy
import
DummyCost
,
DummyCostPlotComp
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
...
...
@@ -59,9 +60,13 @@ def topfarm_generator():
(
EasyScipyOptimizeDriver
(
tol
=
1e-3
),
1e-2
),
(
EasyScipyOptimizeDriver
(
maxiter
=
13
),
1e-1
),
(
EasyScipyOptimizeDriver
(
optimizer
=
'
COBYLA
'
,
tol
=
1e-3
),
1e-2
),
#(EasyPyOptSparseSLSQP(),??),
(
EasySimpleGADriver
(),
1e-4
)][
-
1
:])
(
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
.
optimize
()
tb_pos
=
tf
.
turbine_positions
...
...
This diff is collapsed.
Click to expand it.
tests/topfarm/test_topfarm.py
+
0
−
5
View file @
91c1b125
'''
Created on 17. maj 2018
@author: mmpe
'''
from
topfarm
import
TopFarm
import
numpy
as
np
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment