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
2cb2166f
Commit
2cb2166f
authored
9 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
fixing a few issues in DLCHighLevel
parent
535acbcd
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/dlc/high_level.py
+4
-3
4 additions, 3 deletions
wetb/dlc/high_level.py
with
4 additions
and
3 deletions
wetb/dlc/high_level.py
+
4
−
3
View file @
2cb2166f
...
@@ -29,7 +29,7 @@ def Weibull2(u, k, wsp_lst):
...
@@ -29,7 +29,7 @@ def Weibull2(u, k, wsp_lst):
class
DLCHighLevel
(
object
):
class
DLCHighLevel
(
object
):
def
__init__
(
self
,
filename
,
fail_on_resfile_not_found
=
False
,
shape_k
=
0.2
):
def
__init__
(
self
,
filename
,
fail_on_resfile_not_found
=
False
,
shape_k
=
2.0
):
self
.
filename
=
filename
self
.
filename
=
filename
self
.
fail_on_resfile_not_found
=
fail_on_resfile_not_found
self
.
fail_on_resfile_not_found
=
fail_on_resfile_not_found
...
@@ -53,13 +53,14 @@ class DLCHighLevel(object):
...
@@ -53,13 +53,14 @@ class DLCHighLevel(object):
self
.
dlc_df
.
fillna
(
''
,
inplace
=
True
)
self
.
dlc_df
.
fillna
(
''
,
inplace
=
True
)
# force headers to lower case
# force headers to lower case
self
.
dlc_df
.
columns
=
[
k
.
lower
()
for
k
in
self
.
dlc_df
.
columns
]
self
.
dlc_df
.
columns
=
[
k
.
lower
()
for
k
in
self
.
dlc_df
.
columns
]
# ignore rows where column dlc is empty
self
.
dlc_df
=
self
.
dlc_df
[
self
.
dlc_df
[
'
name
'
]
!=
''
]
for
k
in
[
'
load
'
,
'
dlc_dist
'
,
'
wsp_dist
'
]:
for
k
in
[
'
load
'
,
'
dlc_dist
'
,
'
wsp_dist
'
]:
assert
k
.
lower
()
in
self
.
dlc_df
.
keys
(),
"
DLC sheet must have a
'
%s
'
column
"
%
k
assert
k
.
lower
()
in
self
.
dlc_df
.
keys
(),
"
DLC sheet must have a
'
%s
'
column
"
%
k
self
.
dist_value_keys
=
[(
'
dlc_dist
'
,
'
dlc
'
),
(
'
wsp_dist
'
,
'
wsp
'
)]
self
.
dist_value_keys
=
[(
'
dlc_dist
'
,
'
dlc
'
),
(
'
wsp_dist
'
,
'
wsp
'
)]
self
.
dist_value_keys
.
extend
([(
k
,
k
.
replace
(
"
_dist
"
,
""
))
self
.
dist_value_keys
.
extend
([(
k
,
k
.
replace
(
"
_dist
"
,
""
))
for
k
in
self
.
dlc_df
.
keys
()
for
k
in
self
.
dlc_df
.
keys
()
if
k
.
endswith
(
"
_dist
"
)
if
k
.
endswith
(
"
_dist
"
)
and
k
not
in
(
'
dlc_dist
'
,
'
wsp_dist
'
)])
and
k
not
in
(
'
dlc_dist
'
,
'
wsp_dist
'
)])
for
i
,
(
dk
,
vk
)
in
enumerate
(
self
.
dist_value_keys
):
for
i
,
(
dk
,
vk
)
in
enumerate
(
self
.
dist_value_keys
):
try
:
try
:
msg
=
"
DLC sheet must have a
'
%s
'
-column when having a
'
%s
'
-column
"
msg
=
"
DLC sheet must have a
'
%s
'
-column when having a
'
%s
'
-column
"
...
...
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