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
wtlib
WindEnergyToolbox
Commits
58378dfb
Commit
58378dfb
authored
8 years ago
by
davidovitch
Browse files
Options
Downloads
Patches
Plain Diff
add var tag func to dlctemplate following tjul input/output structure
parent
f34f6345
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wetb/prepost/dlctemplate.py
+71
-0
71 additions, 0 deletions
wetb/prepost/dlctemplate.py
with
71 additions
and
0 deletions
wetb/prepost/dlctemplate.py
+
71
−
0
View file @
58378dfb
...
...
@@ -182,6 +182,77 @@ def variable_tag_func(master, case_id_short=False):
return
master
def
variable_tag_func_mod1
(
master
,
case_id_short
=
False
):
"""
CAUTION: this is version will add an additional layer in the folder
structure in order to seperate input and output file types:
input:
htc
DLCs
data
control
output:
res
logfiles
Function which updates HtcMaster.tags and returns an HtcMaster object
Only use lower case characters for case_id since a hawc2 result and
logfile are always in lower case characters.
BE CAREFULL: if you change a master tag that is used to dynamically
calculate an other tag, that change will be propageted over all cases,
for example:
master.tags[
'
tag1
'
] *= master.tags[tag2]*master.tags[tag3
'
]
it will accumlate over each new case. After 20 cases
master.tags[
'
tag1
'
] = (master.tags[tag2]*master.tags[tag3
'
])^20
which is not wanted, you should do
master.tags[
'
tag1
'
] = tag1_base*master.tags[tag2]*master.tags[tag3
'
]
This example is based on reading the default DLC spreadsheets, and is
already included in the dlcdefs.excel_stabcon
"""
mt
=
master
.
tags
mt
[
'
[Case folder]
'
]
=
mt
[
'
[Case folder]
'
].
lower
()
dlc_case
=
mt
[
'
[Case folder]
'
]
if
'
[Case id.]
'
in
mt
.
keys
():
mt
[
'
[case_id]
'
]
=
mt
[
'
[Case id.]
'
].
lower
()
if
'
[time stop]
'
in
mt
.
keys
():
mt
[
'
[time_stop]
'
]
=
mt
[
'
[time stop]
'
]
else
:
mt
[
'
[time stop]
'
]
=
mt
[
'
[time_stop]
'
]
try
:
mt
[
'
[turb_base_name]
'
]
=
mt
[
'
[Turb base name]
'
]
except
KeyError
:
mt
[
'
[turb_base_name]
'
]
=
None
mt
[
'
[data_dir]
'
]
=
'
input/data/
'
mt
[
'
[res_dir]
'
]
=
'
output/res/%s/
'
%
dlc_case
mt
[
'
[log_dir]
'
]
=
'
output/logfiles/%s/
'
%
dlc_case
mt
[
'
[htc_dir]
'
]
=
'
input/htc/%s/
'
%
dlc_case
try
:
mt
[
'
[time_stop]
'
]
=
mt
[
'
[time stop]
'
]
except
KeyError
:
mt
[
'
[time stop]
'
]
=
mt
[
'
[time_stop]
'
]
mt
[
'
[DLC]
'
]
=
mt
[
'
[Case id.]
'
].
split
(
'
_
'
)[
0
][
3
:]
mt
[
'
[pbs_out_dir]
'
]
=
'
output/pbs_out/%s/
'
%
dlc_case
mt
[
'
[pbs_in_dir]
'
]
=
'
output/pbs_in/%s/
'
%
dlc_case
mt
[
'
[iter_dir]
'
]
=
'
output/iter/%s/
'
%
dlc_case
if
'
[eigen_analysis]
'
in
mt
and
mt
[
'
[eigen_analysis]
'
]:
rpl
=
os
.
path
.
join
(
dlc_case
,
mt
[
'
[Case id.]
'
])
mt
[
'
[eigenfreq_dir]
'
]
=
'
output/res_eigen/%s/
'
%
rpl
mt
[
'
[duration]
'
]
=
str
(
float
(
mt
[
'
[time_stop]
'
])
-
float
(
mt
[
'
[t0]
'
]))
# replace nan with empty
for
ii
,
jj
in
mt
.
items
():
if
jj
==
'
nan
'
:
mt
[
ii
]
=
''
return
master
# =============================================================================
### PRE- POST
# =============================================================================
...
...
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