Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
927e8d70
Commit
927e8d70
authored
Jul 09, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generic plugin method that takes encoded Excel data and changes it to DREAM style list
parent
8b2055c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
dream/plugins/plugin.py
dream/plugins/plugin.py
+16
-0
No files found.
dream/plugins/plugin.py
View file @
927e8d70
from
copy
import
deepcopy
from
copy
import
deepcopy
import
json
import
json
import
numpy
import
numpy
import
xlrd
from
zope.dottedname.resolve
import
resolve
from
zope.dottedname.resolve
import
resolve
...
@@ -76,6 +77,21 @@ class Plugin(object):
...
@@ -76,6 +77,21 @@ class Plugin(object):
def
getNameFromId
(
self
,
data
,
node_id
):
def
getNameFromId
(
self
,
data
,
node_id
):
return
data
[
'graph'
][
'node'
][
node_id
][
'name'
]
return
data
[
'graph'
][
'node'
][
node_id
][
'name'
]
# gets an encoded excel workbook and a sheet name. It converts the data of the
# sheet to the DREAM JSON format for spreadsheets
def
convertExcelToList
(
self
,
ExcelData
,
sheetName
):
mime_type
,
attachement_data
=
ExcelData
[
len
(
'data:'
):].
split
(
';base64,'
,
1
)
attachement_data
=
attachement_data
.
decode
(
'base64'
)
wbin
=
xlrd
.
open_workbook
(
file_contents
=
attachement_data
)
sheet
=
wbin
.
sheet_by_name
(
sheetName
)
listData
=
[]
for
i
in
range
(
sheet
.
nrows
):
listData
.
append
([])
for
j
in
range
(
sheet
.
ncols
):
listData
[
i
].
append
(
sheet
.
cell
(
i
,
j
).
value
)
return
listData
class
ExecutionPlugin
(
Plugin
):
class
ExecutionPlugin
(
Plugin
):
"""Plugin to handle the execution of multiple simulation runs.
"""Plugin to handle the execution of multiple simulation runs.
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment