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
818eebb5
Commit
818eebb5
authored
7 years ago
by
Mikkel Friis-Møller
Browse files
Options
Downloads
Patches
Plain Diff
maybe fix of failing empty line problem in dlc highlevel
parent
001554cf
Branches
41-dlc-highlevel-fails-on-empty-line-in-dlc-sheet
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
wetb/dlc/high_level.py
+1
-0
1 addition, 0 deletions
wetb/dlc/high_level.py
wetb/dlc/tests/test_files/DLC_test.xlsx
+0
-0
0 additions, 0 deletions
wetb/dlc/tests/test_files/DLC_test.xlsx
wetb/dlc/tests/test_high_level.py
+3
-1
3 additions, 1 deletion
wetb/dlc/tests/test_high_level.py
with
4 additions
and
1 deletion
wetb/dlc/high_level.py
+
1
−
0
View file @
818eebb5
...
@@ -100,6 +100,7 @@ class DLCHighLevel(object):
...
@@ -100,6 +100,7 @@ class DLCHighLevel(object):
self
.
dlc_df
=
pd
.
read_excel
(
self
.
filename
,
sheetname
=
'
DLC
'
,
skiprows
=
[
1
])
self
.
dlc_df
=
pd
.
read_excel
(
self
.
filename
,
sheetname
=
'
DLC
'
,
skiprows
=
[
1
])
# empty strings are now nans, convert back to empty strings
# empty strings are now nans, convert back to empty strings
self
.
dlc_df
.
fillna
(
''
,
inplace
=
True
)
self
.
dlc_df
.
fillna
(
''
,
inplace
=
True
)
self
.
dlc_df
.
fillna
(
'
\n
'
,
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
]
if
'
dlc
'
not
in
self
.
dlc_df
.
columns
and
'
name
'
in
self
.
dlc_df
.
columns
:
if
'
dlc
'
not
in
self
.
dlc_df
.
columns
and
'
name
'
in
self
.
dlc_df
.
columns
:
...
...
This diff is collapsed.
Click to expand it.
wetb/dlc/tests/test_files/DLC_test.xlsx
+
0
−
0
View file @
818eebb5
No preview for this file type
This diff is collapsed.
Click to expand it.
wetb/dlc/tests/test_high_level.py
+
3
−
1
View file @
818eebb5
...
@@ -31,7 +31,6 @@ class TestDLCHighLevel(unittest.TestCase):
...
@@ -31,7 +31,6 @@ class TestDLCHighLevel(unittest.TestCase):
def
test_sensor_info_filter
(
self
):
def
test_sensor_info_filter
(
self
):
self
.
assertEqual
(
list
(
self
.
dlc_hl
.
sensor_info
([
'
fatigue
'
]).
m
),
[
4
,
4
,
10
])
self
.
assertEqual
(
list
(
self
.
dlc_hl
.
sensor_info
([
'
fatigue
'
]).
m
),
[
4
,
4
,
10
])
def
test_fatigue_distribution_pct
(
self
):
def
test_fatigue_distribution_pct
(
self
):
dlc
,
wsp
,
wdir
=
self
.
dlc_hl
.
fatigue_distribution
()[
'
12
'
]
dlc
,
wsp
,
wdir
=
self
.
dlc_hl
.
fatigue_distribution
()[
'
12
'
]
self
.
assertEqual
(
dlc
[
12
],
0.975
)
self
.
assertEqual
(
dlc
[
12
],
0.975
)
...
@@ -46,6 +45,9 @@ class TestDLCHighLevel(unittest.TestCase):
...
@@ -46,6 +45,9 @@ class TestDLCHighLevel(unittest.TestCase):
self
.
assertEqual
(
max
(
wsp
.
keys
()),
25
)
self
.
assertEqual
(
max
(
wsp
.
keys
()),
25
)
self
.
assertEqual
(
wsp
[
4
],
"
#1000
"
)
self
.
assertEqual
(
wsp
[
4
],
"
#1000
"
)
def
test_fatigue_distribution_empty_line
(
self
):
self
.
dlc_hl
.
dlc_df
[
'
load
'
]
def
test_file_hour_lst
(
self
):
def
test_file_hour_lst
(
self
):
f
,
h
=
self
.
dlc_hl
.
file_hour_lst
()[
0
]
f
,
h
=
self
.
dlc_hl
.
file_hour_lst
()[
0
]
self
.
assertEqual
(
os
.
path
.
abspath
(
f
),
os
.
path
.
abspath
(
testfilepath
+
'
res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s3001.sel
'
))
self
.
assertEqual
(
os
.
path
.
abspath
(
f
),
os
.
path
.
abspath
(
testfilepath
+
'
res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s3001.sel
'
))
...
...
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