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
7038fbfe
Commit
7038fbfe
authored
9 years ago
by
panos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The Output Preparation script ammended to fix some errors
parent
f076c38a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
dream/KnowledgeExtraction/PilotCases/CapacityStations/OutputPreparation.py
...traction/PilotCases/CapacityStations/OutputPreparation.py
+9
-7
No files found.
dream/KnowledgeExtraction/PilotCases/CapacityStations/OutputPreparation.py
View file @
7038fbfe
...
...
@@ -35,13 +35,14 @@ def OutputPreparation(data,extractedData):
currentDate
=
datetime
.
strptime
(
currentDate
,
'%Y/%m/%d'
)
# set the interval capacity of the stations
for
operationId
,
operation
in
operations
.
iteritems
():
intervalCapacity
=
operation
.
get
(
'intervalCapacity'
,[])
for
stationId
,
station
in
stations
.
iteritems
():
if
stationId
==
operationId
:
station
[
'intervalCapacity'
]
=
intervalCapacity
#
for operationId, operation in operations.iteritems():
#
intervalCapacity=operation.get('intervalCapacity',[])
#
for stationId, station in stations.iteritems():
#
if stationId==operationId:
#
station['intervalCapacity']=intervalCapacity
orders
=
dbJSON
.
get
(
'orders'
,{})
configurationJSON
[
'input'
][
'BOM'
]
=
{}
configurationJSON
[
'input'
][
'BOM'
][
'productionOrders'
]
=
[]
capacityRequirementDict
=
{}
...
...
@@ -51,9 +52,11 @@ def OutputPreparation(data,extractedData):
operationId
=
operation
.
keys
()[
0
]
capacityRequirementDict
[
operationId
]
=
operation
[
operationId
][
'requiredCapacity'
]
earliestStart
=
operation
[
operationId
].
get
(
'earliestStart'
,
None
)
if
earliestStart
:
try
:
earliestStart
=
datetime
.
strptime
(
earliestStart
,
'%Y-%m-%d'
)
earliestStartDict
[
operationId
]
=
(
earliestStart
-
currentDate
).
days
except
ValueError
:
continue
assemblySpaceRequirement
=
order
.
get
(
'floorSpaceRequired'
,
100
)
orderId
=
order
[
'orderID'
]
dueDate
=
order
.
get
(
'dueDate'
,
100
)
...
...
@@ -98,7 +101,6 @@ def OutputPreparation(data,extractedData):
# updatedModelJSONString=json.dumps(configurationJSON, indent=5)
# updatedModel=open('UpdatedModel.json', mode='w')
# updatedModel.write(updatedModelJSONString)
return
configurationJSON
...
...
This diff is collapsed.
Click to expand it.
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