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
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
Christian Pavese
WindEnergyToolbox
Commits
419c2f59
Commit
419c2f59
authored
8 years ago
by
mads
Browse files
Options
Downloads
Patches
Plain Diff
test fail fixes
parent
e6856608
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wetb/hawc2/htc_file.py
+3
-3
3 additions, 3 deletions
wetb/hawc2/htc_file.py
wetb/hawc2/tests/test_htc_file.py
+4
-4
4 additions, 4 deletions
wetb/hawc2/tests/test_htc_file.py
with
7 additions
and
7 deletions
wetb/hawc2/htc_file.py
+
3
−
3
View file @
419c2f59
...
@@ -104,10 +104,10 @@ class HTCFile(HTCContents, HTCDefaults):
...
@@ -104,10 +104,10 @@ class HTCFile(HTCContents, HTCDefaults):
fid
.
write
(
str
(
self
))
fid
.
write
(
str
(
self
))
def
set_name
(
self
,
name
,
folder
=
"
htc/
"
):
def
set_name
(
self
,
name
,
folder
=
"
htc/
"
):
if
os
.
path
.
isabs
(
folder
)
is
False
and
os
.
path
.
relpath
(
folder
).
startswith
(
"
htc
"
+
os
.
path
.
sep
):
#
if os.path.isabs(folder) is False and os.path.relpath(folder).startswith("htc" + os.path.sep):
folder
=
"
./
"
+
os
.
path
.
relpath
(
folder
).
replace
(
"
\\
"
,
"
/
"
)
folder
=
"
./
"
+
os
.
path
.
relpath
(
folder
).
replace
(
"
\\
"
,
"
/
"
)
self
.
filename
=
os
.
path
.
join
(
self
.
modelpath
,
folder
,
"
%s.htc
"
%
name
).
replace
(
"
\\
"
,
"
/
"
)
self
.
filename
=
os
.
path
.
relpath
(
os
.
path
.
join
(
self
.
modelpath
,
folder
,
"
%s.htc
"
%
name
)
)
.
replace
(
"
\\
"
,
"
/
"
)
if
'
simulation
'
in
self
and
'
logfile
'
in
self
.
simulation
:
if
'
simulation
'
in
self
and
'
logfile
'
in
self
.
simulation
:
self
.
simulation
.
logfile
=
os
.
path
.
join
(
folder
.
replace
(
"
htc
"
,
"
log
"
,
1
),
"
%s.log
"
%
name
).
replace
(
"
\\
"
,
"
/
"
)
self
.
simulation
.
logfile
=
os
.
path
.
join
(
folder
.
replace
(
"
htc
"
,
"
log
"
,
1
),
"
%s.log
"
%
name
).
replace
(
"
\\
"
,
"
/
"
)
elif
'
test_structure
'
in
self
and
'
logfile
'
in
self
.
test_structure
:
elif
'
test_structure
'
in
self
and
'
logfile
'
in
self
.
test_structure
:
...
...
This diff is collapsed.
Click to expand it.
wetb/hawc2/tests/test_htc_file.py
+
4
−
4
View file @
419c2f59
...
@@ -118,9 +118,9 @@ class TestHtcFile(unittest.TestCase):
...
@@ -118,9 +118,9 @@ class TestHtcFile(unittest.TestCase):
htcfile
.
add_mann_turbulence
(
30.1
,
1.1
,
3.3
,
102
,
False
)
htcfile
.
add_mann_turbulence
(
30.1
,
1.1
,
3.3
,
102
,
False
)
s
=
"""
begin mann;
s
=
"""
begin mann;
create_turb_parameters
\t
30.1 1.1 3.3 102 0;
\t
L, alfaeps, gamma, seed, highfrq compensation
create_turb_parameters
\t
30.1 1.1 3.3 102 0;
\t
L, alfaeps, gamma, seed, highfrq compensation
filename_u
\t
./turb/
turb_wsp10
_s0102u.
bin
;
filename_u
\t
./turb/
l30.1_ae1.10_g3.3_h0_4096x32x32_1.465x3.12x3.12
_s0102u.
turb
;
filename_v
\t
./turb/
turb_wsp10
_s0102v.
bin
;
filename_v
\t
./turb/
l30.1_ae1.10_g3.3_h0_4096x32x32_1.465x3.12x3.12
_s0102v.
turb
;
filename_w
\t
./turb/
turb_wsp10
_s0102w.
bin
;
filename_w
\t
./turb/
l30.1_ae1.10_g3.3_h0_4096x32x32_1.465x3.12x3.12
_s0102w.
turb
;
box_dim_u
\t
4096 1.4652;
box_dim_u
\t
4096 1.4652;
box_dim_v
\t
32 3.2258;
box_dim_v
\t
32 3.2258;
box_dim_w
\t
32 3.2258;
box_dim_w
\t
32 3.2258;
...
@@ -212,7 +212,7 @@ class TestHtcFile(unittest.TestCase):
...
@@ -212,7 +212,7 @@ class TestHtcFile(unittest.TestCase):
self
.
assertIn
(
os
.
path
.
abspath
(
self
.
testfilepath
+
'
orientation.dat
'
),
[
os
.
path
.
abspath
(
f
)
for
f
in
htcfile
.
input_files
()])
self
.
assertIn
(
os
.
path
.
abspath
(
self
.
testfilepath
+
'
orientation.dat
'
),
[
os
.
path
.
abspath
(
f
)
for
f
in
htcfile
.
input_files
()])
self
.
assertIn
(
'
./data/NREL_5MW_st1.txt
'
,
htcfile
.
input_files
())
self
.
assertIn
(
'
./data/NREL_5MW_st1.txt
'
,
htcfile
.
input_files
())
self
.
assertEqual
(
str
(
htcfile
).
count
(
"
exit
"
),
1
)
self
.
assertEqual
(
str
(
htcfile
).
count
(
"
exit
"
),
1
)
self
.
assertIn
(
'
filename
\t
./res/oc4_p2_
L
oad_case_eq;
'
,
str
(
htcfile
))
self
.
assertIn
(
'
filename
\t
./res/oc4_p2_
l
oad_case_eq;
'
,
str
(
htcfile
))
def
test_tjul_example
(
self
):
def
test_tjul_example
(
self
):
htcfile
=
HTCFile
(
self
.
testfilepath
+
"
./tjul.htc
"
,
"
.
"
)
htcfile
=
HTCFile
(
self
.
testfilepath
+
"
./tjul.htc
"
,
"
.
"
)
...
...
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