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
cf15be69
Commit
cf15be69
authored
8 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
prepost: consistently make case_id/log/res file names lower case due to HAWC2
parent
918846bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wetb/prepost/Simulations.py
+11
-13
11 additions, 13 deletions
wetb/prepost/Simulations.py
wetb/prepost/dlctemplate.py
+0
-1
0 additions, 1 deletion
wetb/prepost/dlctemplate.py
with
11 additions
and
14 deletions
wetb/prepost/Simulations.py
+
11
−
13
View file @
cf15be69
...
...
@@ -1118,7 +1118,7 @@ def post_launch(cases, save_iter=False, silent=False, suffix=None,
# file. If it is a directory, it will check all that is in the dir
run_dir
=
cases
[
k
][
'
[run_dir]
'
]
log_dir
=
cases
[
k
][
'
[log_dir]
'
]
errorlogs
.
PathToLogs
=
os
.
path
.
join
(
run_dir
,
log_dir
,
kk
)
errorlogs
.
PathToLogs
=
os
.
path
.
join
(
run_dir
,
log_dir
)
try
:
errorlogs
.
check
(
save_iter
=
save_iter
)
if
not
silent
:
...
...
@@ -1809,6 +1809,12 @@ class HtcMaster(object):
htc
=
self
.
master_str
# FIXME: HAWC2 always outputs result and logfile in lower case, so
# force case_id/Case id. to be lower case
self
.
tags
[
'
[case_id]
'
]
=
self
.
tags
[
'
[case_id]
'
].
lower
()
if
'
[Case id.]
'
in
self
.
tags
:
self
.
tags
[
'
[Case id.]
'
]
=
self
.
tags
[
'
[Case id.]
'
].
lower
()
# and now replace all the tags in the htc master file
# when iterating over a dict, it will give the key, given in the
# corresponding format (string keys as strings, int keys as ints...)
...
...
@@ -2626,7 +2632,8 @@ class PBS(object):
run_dir
=
case
[
'
[run_dir]
'
]
res_dir
=
case
[
'
[res_dir]
'
]
log_dir
=
case
[
'
[log_dir]
'
]
cname_
=
cname
.
replace
(
'
.htc
'
,
''
)
# FIXME: HAWC2 outputs result and logfile always in lower cases
cname_
=
cname
.
replace
(
'
.htc
'
,
''
).
lower
()
f_log
=
os
.
path
.
join
(
run_dir
,
log_dir
,
cname_
)
f_res
=
os
.
path
.
join
(
run_dir
,
res_dir
,
cname_
)
if
not
os
.
path
.
exists
(
f_log
+
'
.log
'
):
...
...
@@ -2729,14 +2736,13 @@ class ErrorLogs(windIO.LogFile):
# walk trough the files present in the folder path
for
fname
in
FileList
[
0
][
2
]:
fname_lower
=
fname
.
lower
()
# progress indicator
if
NrFiles
>
1
:
if
not
self
.
silent
:
print
(
'
progress:
'
+
str
(
i
)
+
'
/
'
+
str
(
NrFiles
))
# open the current log file
f_log
=
os
.
path
.
join
(
self
.
PathToLogs
,
str
(
fname
_lower
)
)
f_log
=
os
.
path
.
join
(
self
.
PathToLogs
,
fname
)
if
self
.
cases
is
not
None
:
case
=
self
.
cases
[
fname
.
replace
(
'
.log
'
,
'
.htc
'
)]
...
...
@@ -3615,7 +3621,7 @@ class Cases(object):
respath
=
os
.
path
.
join
(
case
[
'
[run_dir]
'
],
case
[
'
[res_dir]
'
])
resfile
=
case
[
'
[case_id]
'
]
self
.
res
=
windIO
.
LoadResults
(
respath
,
resfile
)
self
.
res
=
windIO
.
LoadResults
(
respath
,
resfile
.
lower
()
)
if
not
_slice
:
_slice
=
np
.
r_
[
0
:
len
(
self
.
res
.
sig
)]
self
.
time
=
self
.
res
.
sig
[
_slice
,
0
]
...
...
@@ -3677,12 +3683,6 @@ class Cases(object):
#return cases
def
force_lower_case_id
(
self
):
tmp_cases
=
{}
for
cname
,
case
in
self
.
cases
.
items
():
tmp_cases
[
cname
.
lower
()]
=
case
.
copy
()
self
.
cases
=
tmp_cases
def
_get_cases_dict
(
self
,
post_dir
,
sim_id
):
"""
Load the pickled dictionary containing all the cases and their
...
...
@@ -3699,8 +3699,6 @@ class Cases(object):
self
.
cases
=
load_pickled_file
(
os
.
path
.
join
(
post_dir
,
sim_id
+
'
.pkl
'
))
self
.
cases_fail
=
{}
self
.
force_lower_case_id
()
if
self
.
rem_failed
:
try
:
self
.
load_failed
(
sim_id
)
...
...
This diff is collapsed.
Click to expand it.
wetb/prepost/dlctemplate.py
+
0
−
1
View file @
cf15be69
...
...
@@ -279,7 +279,6 @@ def post_launch(sim_id, statistics=True, rem_failed=True, check_logs=True,
config
[
'
Weibull
'
][
'
Vref
'
]
=
50
config
[
'
nn_shaft
'
]
=
4
cc
=
sim
.
Cases
(
POST_DIR
,
sim_id
,
rem_failed
=
rem_failed
,
config
=
config
)
cc
.
force_lower_case_id
()
if
force_dir
:
for
case
in
cc
.
cases
:
...
...
This diff is collapsed.
Click to expand it.
David Verelst
@dave
mentioned in commit
39c81d83
·
8 years ago
mentioned in commit
39c81d83
mentioned in commit 39c81d834ab1294a9d85112ec4cd9bb741017987
Toggle commit list
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