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
0c04022e
There was a problem fetching the pipeline summary.
Commit
0c04022e
authored
9 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
wetb.dlcdefs: fix PY2/3 compatibility issue
parent
d2ba7339
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wetb/prepost/dlcdefs.py
+10
-9
10 additions, 9 deletions
wetb/prepost/dlcdefs.py
with
10 additions
and
9 deletions
wetb/prepost/dlcdefs.py
+
10
−
9
View file @
0c04022e
...
@@ -9,6 +9,7 @@ from __future__ import unicode_literals
...
@@ -9,6 +9,7 @@ from __future__ import unicode_literals
from
__future__
import
division
from
__future__
import
division
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
builtins
import
str
from
builtins
import
str
from
future.utils
import
viewitems
from
future
import
standard_library
from
future
import
standard_library
standard_library
.
install_aliases
()
standard_library
.
install_aliases
()
...
@@ -284,7 +285,7 @@ def excel_stabcon(proot, fext='xlsx', pignore=None, sheet=0,
...
@@ -284,7 +285,7 @@ def excel_stabcon(proot, fext='xlsx', pignore=None, sheet=0,
opt_tags
=
[]
opt_tags
=
[]
for
dlc
,
df
in
df_list
.
items
(
):
for
(
dlc
,
df
)
in
viewitems
(
df_list
):
# replace ';' with False, and Nan(='') with True
# replace ';' with False, and Nan(='') with True
# this is more easy when testing for the presence of stuff compared
# this is more easy when testing for the presence of stuff compared
# to checking if a value is either True/False or ''/';'
# to checking if a value is either True/False or ''/';'
...
@@ -298,19 +299,19 @@ def excel_stabcon(proot, fext='xlsx', pignore=None, sheet=0,
...
@@ -298,19 +299,19 @@ def excel_stabcon(proot, fext='xlsx', pignore=None, sheet=0,
for
count
,
row
in
df2
.
iterrows
():
for
count
,
row
in
df2
.
iterrows
():
tags_dict
=
{}
tags_dict
=
{}
# construct to dict, convert unicode keys/values to strings
# construct to dict, convert unicode keys/values to strings
for
key
,
value
in
row
.
items
():
for
key
,
value
in
row
.
iter
items
():
if
isinstance
(
value
,
str
):
if
isinstance
(
value
,
str
):
tags_dict
[
str
(
key
)]
=
str
(
value
)
tags_dict
[
str
(
key
)]
=
str
(
value
)
else
:
else
:
tags_dict
[
str
(
key
)]
=
value
tags_dict
[
str
(
key
)]
=
value
# convert ; and empty to False/True
# convert ; and empty to False/True
#
if isinstance(tags_dict[str(key)], str):
if
isinstance
(
tags_dict
[
str
(
key
)],
str
):
if
tags_dict
[
str
(
key
)]
==
'
;
'
:
if
tags_dict
[
str
(
key
)]
==
'
;
'
:
tags_dict
[
str
(
key
)]
=
False
tags_dict
[
str
(
key
)]
=
False
elif
tags_dict
[
str
(
key
)]
==
''
:
elif
tags_dict
[
str
(
key
)]
==
''
:
tags_dict
[
str
(
key
)]
=
True
tags_dict
[
str
(
key
)]
=
True
elif
tags_dict
[
str
(
key
)].
lower
()
==
'
nan
'
:
elif
tags_dict
[
str
(
key
)].
lower
()
==
'
nan
'
:
tags_dict
[
str
(
key
)]
=
True
tags_dict
[
str
(
key
)]
=
True
tags_dict
[
'
[Case folder]
'
]
=
tags_dict
[
'
[Case folder]
'
].
lower
()
tags_dict
[
'
[Case folder]
'
]
=
tags_dict
[
'
[Case folder]
'
].
lower
()
tags_dict
[
'
[Case id.]
'
]
=
tags_dict
[
'
[Case id.]
'
].
lower
()
tags_dict
[
'
[Case id.]
'
]
=
tags_dict
[
'
[Case id.]
'
].
lower
()
...
...
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