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
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
shfe1
WindEnergyToolbox
Commits
01ac2b99
Commit
01ac2b99
authored
8 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
bug fix in process_exec
parent
4cb24d2b
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/simulation.py
+1
-1
1 addition, 1 deletion
wetb/hawc2/simulation.py
wetb/utils/process_exec.py
+3
-2
3 additions, 2 deletions
wetb/utils/process_exec.py
with
4 additions
and
3 deletions
wetb/hawc2/simulation.py
+
1
−
1
View file @
01ac2b99
...
@@ -176,7 +176,7 @@ class Simulation(object):
...
@@ -176,7 +176,7 @@ class Simulation(object):
assert
not
src
.
startswith
(
"
..
"
),
"
%s referes to a file outside the model path
\n
All input files be inside model path
"
%
src
assert
not
src
.
startswith
(
"
..
"
),
"
%s referes to a file outside the model path
\n
All input files be inside model path
"
%
src
return
src
return
src
input_patterns
=
[
fmt
(
src
)
for
src
in
self
.
htcFile
.
input_files
()
+
([],
self
.
htcFile
.
turbulence_files
())[
self
.
copy_turbulence
]
+
self
.
additional_files
().
get
(
'
input
'
,
[])]
input_patterns
=
[
fmt
(
src
)
for
src
in
self
.
htcFile
.
input_files
()
+
([],
self
.
htcFile
.
turbulence_files
())[
self
.
copy_turbulence
]
+
self
.
additional_files
().
get
(
'
input
'
,
[])]
input_files
=
set
([
f
for
pattern
in
input_patterns
for
f
in
glob
.
glob
(
os
.
path
.
join
(
self
.
modelpath
,
pattern
))
if
os
.
path
.
isfile
(
f
)])
input_files
=
set
([
f
for
pattern
in
input_patterns
for
f
in
glob
.
glob
(
os
.
path
.
join
(
self
.
modelpath
,
pattern
))
if
os
.
path
.
isfile
(
f
)
and
"
.hawc2launcher
"
not
in
f
])
if
not
os
.
path
.
isdir
(
os
.
path
.
dirname
(
self
.
modelpath
+
self
.
stdout_filename
)):
if
not
os
.
path
.
isdir
(
os
.
path
.
dirname
(
self
.
modelpath
+
self
.
stdout_filename
)):
os
.
makedirs
(
os
.
path
.
dirname
(
self
.
modelpath
+
self
.
stdout_filename
))
os
.
makedirs
(
os
.
path
.
dirname
(
self
.
modelpath
+
self
.
stdout_filename
))
self
.
host
.
_prepare_simulation
(
input_files
)
self
.
host
.
_prepare_simulation
(
input_files
)
...
...
This diff is collapsed.
Click to expand it.
wetb/utils/process_exec.py
+
3
−
2
View file @
01ac2b99
...
@@ -81,9 +81,10 @@ def unix_filename(filename):
...
@@ -81,9 +81,10 @@ def unix_filename(filename):
f_lst
=
[
f_
for
f_
in
os
.
listdir
(
ufn
)
if
f_
.
lower
()
==
f
.
lower
()]
f_lst
=
[
f_
for
f_
in
os
.
listdir
(
ufn
)
if
f_
.
lower
()
==
f
.
lower
()]
if
len
(
f_lst
)
>
1
:
if
len
(
f_lst
)
>
1
:
f_lst
=
[
f_
for
f_
in
f_lst
if
f_
==
f
]
f_lst
=
[
f_
for
f_
in
f_lst
if
f_
==
f
]
if
len
(
f_lst
)
==
0
:
el
if
len
(
f_lst
)
==
0
:
raise
IOError
(
"'
%s
'
not found in
'
%s
'"
%
(
f
,
ufn
))
raise
IOError
(
"'
%s
'
not found in
'
%s
'"
%
(
f
,
ufn
))
ufn
=
os
.
path
.
join
(
ufn
,
f_lst
[
0
])
else
:
# one match found
ufn
=
os
.
path
.
join
(
ufn
,
f_lst
[
0
])
return
ufn
.
replace
(
"
\\
"
,
"
/
"
)
return
ufn
.
replace
(
"
\\
"
,
"
/
"
)
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