Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WindEnergyToolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
toolbox
WindEnergyToolbox
Commits
a5a37442
There was a problem fetching the pipeline summary.
Commit
a5a37442
authored
8 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
prepost tests: use absolute path when reading data
parent
8a21e29b
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wetb/prepost/tests/test_hawcstab2.py
+8
-7
8 additions, 7 deletions
wetb/prepost/tests/test_hawcstab2.py
wetb/prepost/tests/test_windIO.py
+3
-1
3 additions, 1 deletion
wetb/prepost/tests/test_windIO.py
with
11 additions
and
8 deletions
wetb/prepost/tests/test_hawcstab2.py
+
8
−
7
View file @
a5a37442
...
@@ -11,25 +11,26 @@ from future import standard_library
...
@@ -11,25 +11,26 @@ from future import standard_library
standard_library
.
install_aliases
()
standard_library
.
install_aliases
()
import
unittest
import
unittest
import
os
import
numpy
as
np
import
numpy
as
np
from
wetb.prepost.hawcstab2
import
results
,
hs2_control_tuning
from
wetb.prepost.hawcstab2
import
results
,
hs2_control_tuning
# path for test data files
#fpath = os.path.join(os.path.dirname(__file__), 'data/')
class
Tests
(
unittest
.
TestCase
):
class
Tests
(
unittest
.
TestCase
):
"""
"""
"""
"""
def
setUp
(
self
):
def
setUp
(
self
):
self
.
fpath_linear
=
'
data/controller_input_linear.txt
'
self
.
fpath_linear
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
self
.
fpath_quadratic
=
'
data/controller_input_quadratic.txt
'
'
data/controller_input_linear.txt
'
)
self
.
fpath_quad
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
data/controller_input_quadratic.txt
'
)
def
test_cmb_df
(
self
):
def
test_cmb_df
(
self
):
fname1
=
'
data/campbell_diagram.cmb
'
fname1
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
data/campbell_diagram.cmb
'
)
speed
,
freq
,
damp
=
results
().
load_cmb
(
fname1
)
speed
,
freq
,
damp
=
results
().
load_cmb
(
fname1
)
df
=
results
().
load_cmb_df
(
fname1
)
df
=
results
().
load_cmb_df
(
fname1
)
...
@@ -69,7 +70,7 @@ class Tests(unittest.TestCase):
...
@@ -69,7 +70,7 @@ class Tests(unittest.TestCase):
def
test_quadratic_file
(
self
):
def
test_quadratic_file
(
self
):
hs2
=
hs2_control_tuning
()
hs2
=
hs2_control_tuning
()
hs2
.
read_parameters
(
self
.
fpath_quad
ratic
)
hs2
.
read_parameters
(
self
.
fpath_quad
)
self
.
assertEqual
(
hs2
.
pi_gen_reg1
.
K
,
0.108313E+07
)
self
.
assertEqual
(
hs2
.
pi_gen_reg1
.
K
,
0.108313E+07
)
...
...
This diff is collapsed.
Click to expand it.
wetb/prepost/tests/test_windIO.py
+
3
−
1
View file @
a5a37442
...
@@ -11,6 +11,7 @@ from future import standard_library
...
@@ -11,6 +11,7 @@ from future import standard_library
standard_library
.
install_aliases
()
standard_library
.
install_aliases
()
import
unittest
import
unittest
import
os
import
numpy
as
np
import
numpy
as
np
...
@@ -20,7 +21,8 @@ from wetb.prepost.windIO import LoadResults
...
@@ -20,7 +21,8 @@ from wetb.prepost.windIO import LoadResults
class
TestsLoadResults
(
unittest
.
TestCase
):
class
TestsLoadResults
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
respath
=
'
../../hawc2/tests/test_files/hawc2io/
'
self
.
respath
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
../../hawc2/tests/test_files/hawc2io/
'
)
self
.
fascii
=
'
Hawc2ascii
'
self
.
fascii
=
'
Hawc2ascii
'
self
.
fbin
=
'
Hawc2bin
'
self
.
fbin
=
'
Hawc2bin
'
...
...
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