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
Admin message
The Gitlab server is succesfully updated to version 17.9.2
Show more breadcrumbs
TOPFARM
TopFarm2
Commits
84c72ebf
Commit
84c72ebf
authored
6 years ago
by
Mikkel Friis-Møller
Browse files
Options
Downloads
Patches
Plain Diff
new CI-image and related updates
parent
8b626742
No related branches found
No related tags found
1 merge request
!94
Handle disabled mpi
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docker/Dockerfile_simple
+2
-2
2 additions, 2 deletions
docker/Dockerfile_simple
topfarm/_topfarm.py
+2
-2
2 additions, 2 deletions
topfarm/_topfarm.py
topfarm/tests/topfarm/test_utils.py
+6
-6
6 additions, 6 deletions
topfarm/tests/topfarm/test_utils.py
topfarm/utils.py
+5
-7
5 additions, 7 deletions
topfarm/utils.py
with
15 additions
and
17 deletions
docker/Dockerfile_simple
+
2
−
2
View file @
84c72ebf
...
...
@@ -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://git
hub.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://git
lab.windenergy.dtu.dk/TOPFARM
/FUSED-Wake.git
This diff is collapsed.
Click to expand it.
topfarm/_topfarm.py
+
2
−
2
View file @
84c72ebf
...
...
@@ -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
(
comp
s
=
comp_name_lst
,
compact_print
=
True
)
res
=
self
.
problem
.
check_partials
(
include
s
=
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
()
...
...
This diff is collapsed.
Click to expand it.
topfarm/tests/topfarm/test_utils.py
+
6
−
6
View file @
84c72ebf
...
...
@@ -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.499937
7
,
-
2.999
87763
],
[
6.
,
-
6.9999
7496
],
[
4.49993
7
71
,
-
2.99985
27
3
],
[
3.0000
4123
,
-
6.99995
19
]])
turbines
=
np
.
array
([[
2.4999
8
37
1
,
-
2.999
99965
],
[
6.
,
-
6.9999
9467
],
[
4.4999
8
371
,
-
3.00002
27
9
],
[
3.0000
1007
,
-
7.00001
19
7
]])
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_20180
621_111710
.sql
"
crf
=
"
../test_files/recordings/cases_20180
703_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_20180
621_111710
.sql
'
)
ref_path
=
os
.
path
.
join
(
path
,
'
cases_20180
703_152607
.sql
'
)
assert
latest_id
(
path
)
==
ref_path
def
test_shuffle_positions_abs
():
...
...
This diff is collapsed.
Click to expand it.
topfarm/utils.py
+
5
−
7
View file @
84c72ebf
...
...
@@ -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_20180
621_111710
.sql
"
crf
=
r
"
tests\test_files\recordings\cases_20180
703_152607
.sql
"
case_recorder_filename
=
crf
path
=
os
.
path
.
join
(
this_dir
,
crf
)
turbines
=
pos_from_case
(
path
)
...
...
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