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
9828b6bc
Commit
9828b6bc
authored
Jul 09, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
if elements in shift pattern or skills start or end with space strip ther
parent
0ee0d77e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
dream/plugins/Batches/BatchesOperatorBreaks.py
dream/plugins/Batches/BatchesOperatorBreaks.py
+5
-4
dream/plugins/Batches/ReadSkilledOperators.py
dream/plugins/Batches/ReadSkilledOperators.py
+3
-0
dream/plugins/plugin.py
dream/plugins/plugin.py
+8
-0
No files found.
dream/plugins/Batches/BatchesOperatorBreaks.py
View file @
9828b6bc
...
...
@@ -23,6 +23,10 @@ class BatchesOperatorBreaks(plugin.InputPreparationPlugin, TimeSupportMixin):
continue
date
=
strptime
(
row
[
0
],
'%Y/%m/%d'
)
operators
=
row
[
1
].
split
(
','
)
# if element has spaces in beginning or in end remove them
operators
=
self
.
stripStringsOfList
(
operators
)
i
=
4
while
row
[
i
]
not
in
[
''
,
None
]:
breakStart
=
self
.
convertToSimulationTime
(
strptime
(
"%s %s"
%
(
row
[
0
],
row
[
i
]),
'%Y/%m/%d %H:%M'
))
...
...
@@ -56,8 +60,5 @@ class BatchesOperatorBreaks(plugin.InputPreparationPlugin, TimeSupportMixin):
]
]
}
# import json
# outputJSONString=json.dumps(data['graph']['node'], indent=5)
# outputJSONFile=open('h.json', mode='w')
# outputJSONFile.write(outputJSONString)
return
data
dream/plugins/Batches/ReadSkilledOperators.py
View file @
9828b6bc
...
...
@@ -27,6 +27,9 @@ class ReadSkilledOperators(plugin.InputPreparationPlugin):
continue
skills
=
PBitem
[
1
].
split
(
','
)
skills
=
filter
(
bool
,
skills
)
# if element has spaces in beginning or in end remove them
skills
=
self
.
stripStringsOfList
(
skills
)
newSkills
=
[]
for
n_id
,
n
in
node
.
iteritems
():
technology
=
n
.
get
(
'technology'
,
None
)
...
...
dream/plugins/plugin.py
View file @
9828b6bc
...
...
@@ -47,6 +47,14 @@ class Plugin(object):
# return the average of a list
def
getAverage
(
self
,
value_list
):
return
sum
(
value_list
)
/
float
(
len
(
value_list
))
# takes a list of strings and removes spaces in the beginning or end
def
stripStringsOfList
(
self
,
inputList
):
i
=
0
for
element
in
inputList
:
inputList
[
i
]
=
element
.
strip
()
i
+=
1
return
inputList
# return the standard deviation of a list
def
getStDev
(
self
,
value_list
):
...
...
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