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
a35dc559
Commit
a35dc559
authored
6 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
added warning catch for evaluate
parent
4e005c95
No related branches found
No related tags found
1 merge request
!94
Handle disabled mpi
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
topfarm/topfarm.py
+4
-1
4 additions, 1 deletion
topfarm/topfarm.py
with
4 additions
and
1 deletion
topfarm/topfarm.py
+
4
−
1
View file @
a35dc559
...
@@ -5,6 +5,7 @@ from openmdao.api import Problem, ScipyOptimizeDriver, IndepVarComp
...
@@ -5,6 +5,7 @@ from openmdao.api import Problem, ScipyOptimizeDriver, IndepVarComp
import
numpy
as
np
import
numpy
as
np
from
topfarm.constraint_components.boundary_component
import
BoundaryComp
from
topfarm.constraint_components.boundary_component
import
BoundaryComp
from
topfarm.constraint_components.spacing_component
import
SpacingComp
from
topfarm.constraint_components.spacing_component
import
SpacingComp
import
warnings
class
TopFarm
(
object
):
class
TopFarm
(
object
):
...
@@ -67,7 +68,9 @@ class TopFarm(object):
...
@@ -67,7 +68,9 @@ class TopFarm(object):
def
evaluate
(
self
):
def
evaluate
(
self
):
t
=
time
.
time
()
t
=
time
.
time
()
self
.
problem
.
run_model
()
with
warnings
.
catch_warnings
():
# suppress OpenMDAO/SLSQP warnings
warnings
.
filterwarnings
(
'
ignore
'
,
"
Inefficient choice of derivative mode. You chose
'
rev
'
for a problem with
"
)
self
.
problem
.
run_model
()
print
(
"
Evaluated in
\t
%.3fs
"
%
(
time
.
time
()
-
t
))
print
(
"
Evaluated in
\t
%.3fs
"
%
(
time
.
time
()
-
t
))
return
self
.
get_cost
(),
self
.
turbine_positions
return
self
.
get_cost
(),
self
.
turbine_positions
...
...
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