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
c7925d8d
Commit
c7925d8d
authored
Aug 25, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
e535e39b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
dream/plugins/CapacityStations/ChangeWIPSpreadsheet.py
dream/plugins/CapacityStations/ChangeWIPSpreadsheet.py
+13
-5
No files found.
dream/plugins/CapacityStations/ChangeWIPSpreadsheet.py
View file @
c7925d8d
...
@@ -20,7 +20,6 @@ class ChangeWIPSpreadsheet(plugin.InputPreparationPlugin):
...
@@ -20,7 +20,6 @@ class ChangeWIPSpreadsheet(plugin.InputPreparationPlugin):
if
projectData
[
row
][
0
]
and
not
(
projectData
[
row
][
0
]
in
alreadyConsideredProjects
):
if
projectData
[
row
][
0
]
and
not
(
projectData
[
row
][
0
]
in
alreadyConsideredProjects
):
projectId
=
projectData
[
row
][
0
]
projectId
=
projectData
[
row
][
0
]
alreadyConsideredProjects
.
append
(
projectData
[
row
][
0
])
alreadyConsideredProjects
.
append
(
projectData
[
row
][
0
])
numberOfOperations
=
1
numberOfOperations
=
1
i
=
1
i
=
1
# if the id changes or is empty it means there is no more data on the project
# if the id changes or is empty it means there is no more data on the project
...
@@ -30,8 +29,9 @@ class ChangeWIPSpreadsheet(plugin.InputPreparationPlugin):
...
@@ -30,8 +29,9 @@ class ChangeWIPSpreadsheet(plugin.InputPreparationPlugin):
break
break
numberOfOperations
+=
1
numberOfOperations
+=
1
i
+=
1
i
+=
1
# for every
operation get the wip and define it
# for every
project create a dict to keep what is completed
completedCapacityDict
=
{}
completedCapacityDict
=
{}
# for every project create a dict to keep what is requested
requiredCapacityDict
=
{}
requiredCapacityDict
=
{}
for
stationRecord
in
range
(
numberOfOperations
):
for
stationRecord
in
range
(
numberOfOperations
):
stationId
=
projectData
[
row
+
stationRecord
][
4
]
stationId
=
projectData
[
row
+
stationRecord
][
4
]
...
@@ -39,22 +39,26 @@ class ChangeWIPSpreadsheet(plugin.InputPreparationPlugin):
...
@@ -39,22 +39,26 @@ class ChangeWIPSpreadsheet(plugin.InputPreparationPlugin):
requiredCapacity
=
float
(
projectData
[
row
+
stationRecord
][
5
])
requiredCapacity
=
float
(
projectData
[
row
+
stationRecord
][
5
])
completedCapacityDict
[
stationId
]
=
completedCapacity
completedCapacityDict
[
stationId
]
=
completedCapacity
requiredCapacityDict
[
stationId
]
=
requiredCapacity
requiredCapacityDict
[
stationId
]
=
requiredCapacity
wipDict
=
self
.
calculateWIPDict
(
data
,
completedCapacityDict
,
requiredCapacityDict
)
# create the wip dictionart
wipDict
=
self
.
calculateWIPDict
(
data
,
completedCapacityDict
,
requiredCapacityDict
,
projectId
)
# change the completed data with the wip data in the spreadsheet
for
stationRecord
in
range
(
numberOfOperations
):
for
stationRecord
in
range
(
numberOfOperations
):
stationId
=
projectData
[
row
+
stationRecord
][
4
]
stationId
=
projectData
[
row
+
stationRecord
][
4
]
projectData
[
row
+
stationRecord
][
wipColumn
]
=
wipDict
[
stationId
]
projectData
[
row
+
stationRecord
][
wipColumn
]
=
wipDict
[
stationId
]
return
data
return
data
# gets the dict that shows the completed capacities and returns the one with the actual wip
# gets the dict that shows the completed capacities and returns the one with the actual wip
def
calculateWIPDict
(
self
,
data
,
completedCapacityDict
,
requiredCapacityDict
):
def
calculateWIPDict
(
self
,
data
,
completedCapacityDict
,
requiredCapacityDict
,
projectId
):
wipDict
=
{}
wipDict
=
{}
for
stationId
,
completedCapacity
in
completedCapacityDict
.
iteritems
():
for
stationId
,
completedCapacity
in
completedCapacityDict
.
iteritems
():
previous
=
self
.
getPredecessors
(
data
,
stationId
)
previous
=
self
.
getPredecessors
(
data
,
stationId
)
if
previous
:
if
previous
:
# if the station is assembly
# if the station is assembly
if
len
(
previous
)
>
1
:
if
len
(
previous
)
>
1
:
# if there is capacity completed, then the project was assembled. So set the remaining capacity (if any) as WIP
if
completedCapacityDict
[
stationId
]:
if
completedCapacityDict
[
stationId
]:
wipDict
[
stationId
]
=
requiredCapacityDict
[
stationId
]
-
completedCapacityDict
[
stationId
]
wipDict
[
stationId
]
=
requiredCapacityDict
[
stationId
]
-
completedCapacityDict
[
stationId
]
# else, set wip ONLY if all the pre-decessors have finished this project
else
:
else
:
readyForAssembly
=
True
readyForAssembly
=
True
for
previousId
in
previous
:
for
previousId
in
previous
:
...
@@ -63,13 +67,17 @@ class ChangeWIPSpreadsheet(plugin.InputPreparationPlugin):
...
@@ -63,13 +67,17 @@ class ChangeWIPSpreadsheet(plugin.InputPreparationPlugin):
wipDict
[
stationId
]
=
0
wipDict
[
stationId
]
=
0
if
readyForAssembly
:
if
readyForAssembly
:
wipDict
[
stationId
]
=
requiredCapacityDict
[
stationId
]
wipDict
[
stationId
]
=
requiredCapacityDict
[
stationId
]
# if the station is not assembly but has predecessor
# check what the predecessor has finished and what workload comes to station.
# if the station has already finished some of the workload reduce it from the wip
else
:
else
:
previousId
=
previous
[
0
]
previousId
=
previous
[
0
]
completedFromPrevious
=
completedCapacityDict
[
previousId
]
completedFromPrevious
=
completedCapacityDict
[
previousId
]
transferRate
=
requiredCapacityDict
[
stationId
]
/
float
(
requiredCapacityDict
[
previousId
])
transferRate
=
requiredCapacityDict
[
stationId
]
/
float
(
requiredCapacityDict
[
previousId
])
wipDict
[
stationId
]
=
(
transferRate
*
completedFromPrevious
)
-
completedCapacityDict
[
stationId
]
wipDict
[
stationId
]
=
(
transferRate
*
completedFromPrevious
)
-
completedCapacityDict
[
stationId
]
else
:
else
:
wipDict
[
stationId
]
=
requiredCapacityDict
[
stationId
]
-
completedCapacityDict
[
stationId
]
wipDict
[
stationId
]
=
requiredCapacityDict
[
stationId
]
-
completedCapacityDict
[
stationId
]
assert
not
(
wipDict
[
stationId
]
<
0
),
'invalid WIP definition for '
+
projectId
+
' in '
+
stationId
return
wipDict
return
wipDict
...
...
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