Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
masterThesis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simone Miele
masterThesis
Commits
55a21aa4
Commit
55a21aa4
authored
2 months ago
by
Simone Miele
Browse files
Options
Downloads
Patches
Plain Diff
uplaod
parent
3def3b33
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
g_partner/SGPlaene.csv
+19
-19
19 additions, 19 deletions
g_partner/SGPlaene.csv
g_partner/df_IMM.csv
+24
-0
24 additions, 0 deletions
g_partner/df_IMM.csv
g_partner/df_IMM.xlsx
+0
-0
0 additions, 0 deletions
g_partner/df_IMM.xlsx
g_partner/g_data_SPRI.ipynb
+183
-34
183 additions, 34 deletions
g_partner/g_data_SPRI.ipynb
with
226 additions
and
53 deletions
g_partner/SGPlaene.csv
+
19
−
19
View file @
55a21aa4
ID;
material-nr;TextMat;Budget;minLot;maxLot;roundvalue;
TextPlan;
work
plan;
description;
changeover_H;cycletime_s;employeetime_s;Kavitt;Gebindem.
0;
261.855.00.1;Abzweig PE-HD 45G d56/50 mit Manschette;1914;400;5600;400;SPRI2315
H260216/H260456 (Flex);SPRI2315;Spritzen 2-fach
;2.483;16;1.458;2;400
1;
363.112.16.1;Abzweig PE-HD 45G d56/50;30272;4400;8000;400;SPRI2315
H260216/H260456 (Flex);SPRI2315;Spritzen 2-fach
;2.483;18;2.023;2;400
2;
363.115.16.1;Abzweig PE-HD 45G d56/56;72572;3960;10560;440;SPRI2315
H260216/H260457 (Flex);SPRI2315;Spritzen 2-fach
;2.483;20.9;2.103;2;440
3;
364.112.16.1;Abzweig PE-HD 45G d63/50;27410;2880;16000;320;SPRI2315
H260499/H260502;SPRI2315;Spritzen 2-fach
;2.483;42;2.443;2;320
4;
366.130.16.1;Abzweig PE-HD 45G d90/90;36261;2000;7500;160;SPRI2314
H261914;SPRI2314;Spritzen 1-fach
;2.483;37.6;3.173;1;160
5;
366.887.16.1;Anschlussstutzen PE-HD d90/90;76744;2880;7040;160;SPRI2315
H263663;SPRI2315;Spritzen 1-fach
;2.483;46.9;47.4;1;160
6;
367.792.16.1;AnBogen PE-HD 90G d110/110 L22.5/7.5;4810;1700;6100;100;SPRI2314
H201226;SPRI2314;Spritzen 1-fach
;2.483;48.5;48.5;1;100
7;
367.887.16.1;Anschlussstutzen PE-HD d110/90;21412;1920;6960;120;SPRI2315
H263664;SPRI2315;Spritzen 1-fach
;2.483;59.5;59.5;1;120
8;
368.120.16.1;Abzweig PE-HD 45G d125/63;8785;1280;5600;80;SPRI2314
H261598/H263312;SPRI2314;Spritzen 1-fach
;2.483;60.5;6.153;1;80
9;
368.125.16.1;Abzweig PE-HD 45G d125/75;6934;1600;8800;80;SPRI2314
H261598/H263311;SPRI2314;Spritzen 1-fach
;2.483;58.5;6.138;1;80
10;
368.130.16.1;Abzweig PE-HD 45G d125/90;4715;1200;2400;60;SPRI2314
H261598/H263310;SPRI2314;Spritzen 1-fach
;2.483;65;7.886;1;60
11;
368.135.16.0;Abzweiger 45G D125x110 PE;1691;72;1440;72;SPRI2314
H261598/H261600;SPRI2314;Spritzen 1-fach
;0.25;58.8;6.652;1;72
12;
368.135.16.1;Abzweig PE-HD 45G d125/110;24519;1440;5640;60;SPRI2314
H261598/H261600;SPRI2314;Spritzen 1-fach
;2.483;59.6;7.767;1;60
13;
368.139.16.1;Abzweig PE-HD 45G d125/125;19337;1600;6560;80;SPRI2314
H261598/H261599;SPRI2314;Spritzen 1-fach
;2.483;56.4;6.061;1;80
14;
368.700.16.1;Langmuffe m/Doppelbund PE-HD d125;24014;1680;5680;80;SPRI2315
H265856;SPRI2315;Spritzen 1-fach
;2.483;61.6;61.6;1;80
15;
369.700.16.1;Langmuffe m/Doppelbund PE-HD d160;33957;1040;4800;40;SPRI2315
H265861;SPRI2315;Spritzen 1-fach
;2.483;83.2;83.2;1;40
16;
387.437.16.9;Wandklosettbogen 90G D110x110;189;800;4800;100;SPRI2
130 H201226;SPRI2314;Spritzen 1-fach
;2.483;50;3.2;1;100
17;
862.814.16.0;Bogen D110 barbeitet;43044;3696;7128;264;SPRI2315
H261869;SPRI2315;Spritzen 2-fach
;3.4;23.7;4.6;2;264
material-nr;TextMat;Budget;minLot;maxLot;roundvalue;work
_
plan;changeover_H;cycletime_s;employeetime_s;Kavitt;Gebindem.
261.855.00.1;Abzweig PE-HD 45G d56/50 mit Manschette;1914;400;5600;400;SPRI2315;2.483;16;1.458;2;400
363.112.16.1;Abzweig PE-HD 45G d56/50;30272;4400;8000;400;SPRI2315;2.483;18;2.023;2;400
363.115.16.1;Abzweig PE-HD 45G d56/56;72572;3960;10560;440;SPRI2315;2.483;20.9;2.103;2;440
364.112.16.1;Abzweig PE-HD 45G d63/50;27410;2880;16000;320;SPRI2315;2.483;42;2.443;2;320
366.130.16.1;Abzweig PE-HD 45G d90/90;36261;2000;7500;160;SPRI2314;2.483;37.6;3.173;1;160
366.887.16.1;Anschlussstutzen PE-HD d90/90;76744;2880;7040;160;SPRI2315;2.483;46.9;47.4;1;160
367.792.16.1;AnBogen PE-HD 90G d110/110 L22.5/7.5;4810;1700;6100;100;SPRI2314;2.483;48.5;48.5;1;100
367.887.16.1;Anschlussstutzen PE-HD d110/90;21412;1920;6960;120;SPRI2315;2.483;59.5;59.5;1;120
368.120.16.1;Abzweig PE-HD 45G d125/63;8785;1280;5600;80;SPRI2314;2.483;60.5;6.153;1;80
368.125.16.1;Abzweig PE-HD 45G d125/75;6934;1600;8800;80;SPRI2314;2.483;58.5;6.138;1;80
368.130.16.1;Abzweig PE-HD 45G d125/90;4715;1200;2400;60;SPRI2314;2.483;65;7.886;1;60
368.135.16.0;Abzweiger 45G D125x110 PE;1691;72;1440;72;SPRI2314;0.25;58.8;6.652;1;72
368.135.16.1;Abzweig PE-HD 45G d125/110;24519;1440;5640;60;SPRI2314;2.483;59.6;7.767;1;60
368.139.16.1;Abzweig PE-HD 45G d125/125;19337;1600;6560;80;SPRI2314;2.483;56.4;6.061;1;80
368.700.16.1;Langmuffe m/Doppelbund PE-HD d125;24014;1680;5680;80;SPRI2315;2.483;61.6;61.6;1;80
369.700.16.1;Langmuffe m/Doppelbund PE-HD d160;33957;1040;4800;40;SPRI2315;2.483;83.2;83.2;1;40
387.437.16.9;Wandklosettbogen 90G D110x110;189;800;4800;100;SPRI2
314
;2.483;50;3.2;1;100
862.814.16.0;Bogen D110 barbeitet;43044;3696;7128;264;SPRI2315;3.4;23.7;4.6;2;264
This diff is collapsed.
Click to expand it.
g_partner/df_IMM.csv
0 → 100644
+
24
−
0
View file @
55a21aa4
;material-nr;TextMat;Budget;minLot;maxLot;roundvalue;work_plan;changeover_H;cycletime_s;employeetime_s;Kavitt;Gebindem.;ideal_lot;opt_lot;n_lots;;zeit/jahr;;
0;366.130.16.1;Abzweig PE-HD 45G d90/90;36261;2000;7500;160;SPRI2314;2.483;37.6;3.173;1;160;5266;5266;7;;1363413.6;;
1;367.792.16.1;AnBogen PE-HD 90G d110/110 L22.5/7.5;4810;1700;6100;100;SPRI2314;2.483;48.5;48.5;1;100;4082;4082;2;;233285;;
2;368.120.16.1;Abzweig PE-HD 45G d125/63;8785;1280;5600;80;SPRI2314;2.483;60.5;6.153;1;80;3273;3273;3;;531492.5;;
3;368.125.16.1;Abzweig PE-HD 45G d125/75;6934;1600;8800;80;SPRI2314;2.483;58.5;6.138;1;80;3385;3385;3;;405639;;
4;368.130.16.1;Abzweig PE-HD 45G d125/90;4715;1200;2400;60;SPRI2314;2.483;65;7.886;1;60;3046;2400;2;;306475;;
5;368.135.16.0;Abzweiger 45G D125x110 PE;1691;72;1440;72;SPRI2314;0.25;58.8;6.652;1;72;3367;1440;2;;99430.8;;
6;368.135.16.1;Abzweig PE-HD 45G d125/110;24519;1440;5640;60;SPRI2314;2.483;59.6;7.767;1;60;3322;3322;8;;1461332.4;;
7;368.139.16.1;Abzweig PE-HD 45G d125/125;19337;1600;6560;80;SPRI2314;2.483;56.4;6.061;1;80;3511;3511;6;;1090606.8;;
8;387.437.16.9;Wandklosettbogen 90G D110x110;189;800;4800;100;SPRI2314;2.483;50;3.2;1;100;3960;3960;1;;9450;;
9;261.855.00.1;Abzweig PE-HD 45G d56/50 mit Manschette;1914;400;5600;400;SPRI2315;2.483;16;1.458;2;400;12375;5600;1;;30624;;
10;363.112.16.1;Abzweig PE-HD 45G d56/50;30272;4400;8000;400;SPRI2315;2.483;18;2.023;2;400;11000;8000;4;;544896;;
11;363.115.16.1;Abzweig PE-HD 45G d56/56;72572;3960;10560;440;SPRI2315;2.483;20.9;2.103;2;440;9474;9474;8;;1516754.8;;
12;364.112.16.1;Abzweig PE-HD 45G d63/50;27410;2880;16000;320;SPRI2315;2.483;42;2.443;2;320;4714;4714;6;;1151220;;
13;366.887.16.1;Anschlussstutzen PE-HD d90/90;76744;2880;7040;160;SPRI2315;2.483;46.9;47.4;1;160;4222;4222;19;;3599293.6;;
14;367.887.16.1;Anschlussstutzen PE-HD d110/90;21412;1920;6960;120;SPRI2315;2.483;59.5;59.5;1;120;3328;3328;7;;1274014;;
15;368.700.16.1;Langmuffe m/Doppelbund PE-HD d125;24014;1680;5680;80;SPRI2315;2.483;61.6;61.6;1;80;3214;3214;8;;1479262.4;;
16;369.700.16.1;Langmuffe m/Doppelbund PE-HD d160;33957;1040;4800;40;SPRI2315;2.483;83.2;83.2;1;40;2380;2380;15;;2825222.4;;
17;862.814.16.0;Bogen D110 barbeitet;43044;3696;7128;264;SPRI2315;3.4;23.7;4.6;2;264;8354;7128;7;;1020142.8;;
;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;1528.090306;3733.730556;
;;;;;;;;;;;;;;;;;SPRI2314;SPRI2315;5500
;;;;;;;;;;;;;;;;;27.78%;67.89%;
This diff is collapsed.
Click to expand it.
g_partner/df_IMM.xlsx
0 → 100644
+
0
−
0
View file @
55a21aa4
File added
This diff is collapsed.
Click to expand it.
g_partner/g_data_SPRI.ipynb
+
183
−
34
View file @
55a21aa4
...
...
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count":
null
,
"execution_count":
1
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -15,7 +15,7 @@
},
{
"cell_type": "code",
"execution_count":
null
,
"execution_count":
2
,
"metadata": {},
"outputs": [
{
...
...
@@ -23,7 +23,7 @@
"output_type": "stream",
"text": [
"Loading csv-files and build work df\n",
"Cutpack dataset loaded successfully with 18 rows and 2
3
columns.\n"
"Cutpack dataset loaded successfully with 18 rows and
1
2 columns.\n"
]
}
],
...
...
@@ -39,57 +39,206 @@
" print(f\"Cutpack dataset loaded successfully with {len(df_IMM)} rows and {df_IMM.shape[1]} columns.\")\n",
" #print(f\"IMM dataset loaded successfully with {len(df_IMM)} rows and {df_IMM.shape[1]} columns.\")\n",
"except Exception as e:\n",
" print(f\"Failed to load the file: {e}\")"
" print(f\"Failed to load the file: {e}\")\n",
"\n",
"#df_IMM.dtypes"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# Split based on value production IMM\n",
"df_14 = df_IMM[df_IMM['work_plan'] == 'SPRI2314']\n",
"df_15 = df_IMM[df_IMM['work_plan'] == 'SPRI2315']"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "std
out
",
"name": "std
err
",
"output_type": "stream",
"text": [
" ID Total min_lot max_lot cycle_time_sec ideal_lot opt_lot n_lots\n",
"0 0 957 400 5600 32.0 6188 5600 1\n",
"1 1 15136 4400 8000 36.0 5500 5500 3\n",
"2 2 36286 3960 10560 41.8 4737 4737 8\n",
"3 3 13705 2880 16000 84.0 2357 2880 5\n",
"4 4 36261 2000 7500 37.6 5266 5266 7\n",
"5 5 76744 2880 7040 46.9 4222 4222 19\n",
"6 6 4810 1700 6100 48.5 4082 4082 2\n",
"7 7 21412 1920 6960 59.5 3328 3328 7\n",
"8 8 8785 1280 5600 60.5 3273 3273 3\n",
"9 9 6934 1600 8800 58.5 3385 3385 3\n",
"10 10 4715 1200 2400 65.0 3046 2400 2\n",
"11 11 1691 72 1440 58.8 3367 1440 2\n",
"12 12 24519 1440 5640 59.6 3322 3322 8\n",
"13 13 19337 1600 6560 56.4 3511 3511 6\n",
"14 14 24014 1680 5680 61.6 3214 3214 8\n",
"15 15 33957 1040 4800 83.2 2380 2380 15\n",
"16 16 189 800 4800 50.0 3960 3960 1\n",
"17 17 21522 3696 7128 47.4 4177 4177 6\n"
"C:\\Users\\simone.miele\\AppData\\Local\\Temp\\ipykernel_6580\\1335359789.py:6: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" df_14[\"ideal_lot\"] = (TARGET_RUN_SEC / df_14[\"cycletime_s\"]).round().astype(int)\n",
"C:\\Users\\simone.miele\\AppData\\Local\\Temp\\ipykernel_6580\\1335359789.py:7: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" df_14[\"opt_lot\"] = df_14[\"ideal_lot\"].clip(lower=df_14[\"minLot\"], upper=df_14[\"maxLot\"])\n",
"C:\\Users\\simone.miele\\AppData\\Local\\Temp\\ipykernel_6580\\1335359789.py:10: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" df_14[\"n_lots\"] = (df_14[\"Budget\"] / df_14[\"opt_lot\"]).apply(math.ceil).astype(int)\n",
"C:\\Users\\simone.miele\\AppData\\Local\\Temp\\ipykernel_6580\\1335359789.py:15: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" df_15[\"ideal_lot\"] = (TARGET_RUN_SEC / df_15[\"cycletime_s\"]).round().astype(int)\n",
"C:\\Users\\simone.miele\\AppData\\Local\\Temp\\ipykernel_6580\\1335359789.py:16: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" df_15[\"opt_lot\"] = df_15[\"ideal_lot\"].clip(lower=df_15[\"minLot\"], upper=df_15[\"maxLot\"])\n",
"C:\\Users\\simone.miele\\AppData\\Local\\Temp\\ipykernel_6580\\1335359789.py:19: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
" df_15[\"n_lots\"] = (df_15[\"Budget\"] / df_15[\"opt_lot\"]).apply(math.ceil).astype(int)\n"
]
},
{
"data": {
"application/vnd.microsoft.datawrangler.viewer.v0+json": {
"columns": [
{
"name": "index",
"rawType": "object",
"type": "string"
},
{
"name": "0",
"rawType": "object",
"type": "unknown"
}
],
"ref": "4345815f-c421-4684-8d32-00f21c566d0c",
"rows": [
[
"material-nr",
"261.855.00.1363.112.16.1363.115.16.1364.112.16.1366.887.16.1367.887.16.1368.700.16.1369.700.16.1862.814.16.0"
],
[
"TextMat",
"Abzweig PE-HD 45G d56/50 mit ManschetteAbzweig PE-HD 45G d56/50Abzweig PE-HD 45G d56/56Abzweig PE-HD 45G d63/50Anschlussstutzen PE-HD d90/90Anschlussstutzen PE-HD d110/90Langmuffe m/Doppelbund PE-HD d125Langmuffe m/Doppelbund PE-HD d160Bogen D110 barbeitet"
],
[
"Budget",
"331339"
],
[
"minLot",
"22856"
],
[
"maxLot",
"71768"
],
[
"roundvalue",
"2224"
],
[
"work_plan",
"SPRI2315SPRI2315SPRI2315SPRI2315SPRI2315SPRI2315SPRI2315SPRI2315SPRI2315"
],
[
"changeover_H",
"23.264"
],
[
"cycletime_s",
"371.8"
],
[
"employeetime_s",
"264.32700000000006"
],
[
"Kavitt",
"14"
],
[
"Gebindem.",
"2224"
],
[
"ideal_lot",
"59061"
],
[
"opt_lot",
"48060"
],
[
"n_lots",
"75"
]
],
"shape": {
"columns": 1,
"rows": 15
}
},
"text/plain": [
"material-nr 261.855.00.1363.112.16.1363.115.16.1364.112.16...\n",
"TextMat Abzweig PE-HD 45G d56/50 mit ManschetteAbzweig...\n",
"Budget 331339\n",
"minLot 22856\n",
"maxLot 71768\n",
"roundvalue 2224\n",
"work_plan SPRI2315SPRI2315SPRI2315SPRI2315SPRI2315SPRI23...\n",
"changeover_H 23.264\n",
"cycletime_s 371.8\n",
"employeetime_s 264.327\n",
"Kavitt 14\n",
"Gebindem. 2224\n",
"ideal_lot 59061\n",
"opt_lot 48060\n",
"n_lots 75\n",
"dtype: object"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# target run time per lot (55 h = 55*3600 s, since 5500 h / 50 Weeks / 2 Changeover per Week (assumption by Geberit)) \n",
"TARGET_RUN_SEC = 55 * 3600 \n",
"\n",
"##\n",
"# compute ideal lot size, then clamp to [min_lot, max_lot]\n",
"df_14[\"ideal_lot\"] = (TARGET_RUN_SEC / df_14[\"cycletime_s\"]).round().astype(int)\n",
"df_14[\"opt_lot\"] = df_14[\"ideal_lot\"].clip(lower=df_14[\"minLot\"], upper=df_14[\"maxLot\"])\n",
"\n",
"# compute number of lots needed to meet annual demand ---\n",
"df_14[\"n_lots\"] = (df_14[\"Budget\"] / df_14[\"opt_lot\"]).apply(math.ceil).astype(int)\n",
"\n",
"df_14.sum(axis=0)\n",
"\n",
"# compute ideal lot size, then clamp to [min_lot, max_lot]\n",
"df[\"ideal_lot\"] = (TARGET_RUN_SEC / df[\"cycle
_
time_s
ec
\"]).round().astype(int)\n",
"df[\"opt_lot\"] = df[\"ideal_lot\"].clip(lower=df[\"min
_l
ot\"], upper=df[\"max
_l
ot\"])\n",
"df
_15
[\"ideal_lot\"] = (TARGET_RUN_SEC / df
_15
[\"cycletime_s\"]).round().astype(int)\n",
"df
_15
[\"opt_lot\"] = df
_15
[\"ideal_lot\"].clip(lower=df
_15
[\"min
L
ot\"], upper=df
_15
[\"max
L
ot\"])\n",
"\n",
"#
--- 4)
compute number of lots needed to meet annual demand ---\n",
"df[\"n_lots\"] = (df
[\"Total
\"] / df[\"opt_lot\"]).apply(math.ceil).astype(int)\n",
"# compute number of lots needed to meet annual demand ---\n",
"df
_15
[\"n_lots\"] = (df
_15[\"Budget
\"] / df
_15
[\"opt_lot\"]).apply(math.ceil).astype(int)\n",
"\n",
"# --- 5) report ---\n",
"print(df[[\n",
" \"ID\", \"Total\", \"min_lot\", \"max_lot\", \"cycle_time_sec\",\n",
" \"ideal_lot\", \"opt_lot\", \"n_lots\"\n",
"]])\n"
"df_15.sum(axis=0)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
...
...
%% Cell type:code id: tags:
```
python
# importing
import
pandas
as
pd
import
numpy
as
np
import
math
from
pathlib
import
Path
```
%% Cell type:code id: tags:
```
python
# Load Data
directory
=
str
(
Path
.
cwd
())
dir_IMM
=
directory
+
r
"
\SGPlaene.csv
"
print
(
"
Loading csv-files and build work df
"
)
try
:
# Fast Reading
df_IMM
=
pd
.
read_csv
(
dir_IMM
,
sep
=
"
;
"
,
encoding
=
'
utf-8
'
,
encoding_errors
=
'
ignore
'
)
print
(
f
"
Cutpack dataset loaded successfully with
{
len
(
df_IMM
)
}
rows and
{
df_IMM
.
shape
[
1
]
}
columns.
"
)
#print(f"IMM dataset loaded successfully with {len(df_IMM)} rows and {df_IMM.shape[1]} columns.")
except
Exception
as
e
:
print
(
f
"
Failed to load the file:
{
e
}
"
)
#df_IMM.dtypes
```
%% Output
Loading csv-files and build work df
Cutpack dataset loaded successfully with 18 rows and 23 columns.
Cutpack dataset loaded successfully with 18 rows and 12 columns.
%% Cell type:code id: tags:
```
python
# Split based on value production IMM
df_14
=
df_IMM
[
df_IMM
[
'
work_plan
'
]
==
'
SPRI2314
'
]
df_15
=
df_IMM
[
df_IMM
[
'
work_plan
'
]
==
'
SPRI2315
'
]
```
%% Cell type:code id: tags:
```
python
# target run time per lot (55 h = 55*3600 s, since 5500 h / 50 Weeks / 2 Changeover per Week (assumption by Geberit))
TARGET_RUN_SEC
=
55
*
3600
##
# compute ideal lot size, then clamp to [min_lot, max_lot]
df
[
"
ideal_lot
"
]
=
(
TARGET_RUN_SEC
/
df
[
"
cycle
_
time_s
ec
"
]).
round
().
astype
(
int
)
df
[
"
opt_lot
"
]
=
df
[
"
ideal_lot
"
].
clip
(
lower
=
df
[
"
min
_l
ot
"
],
upper
=
df
[
"
max
_l
ot
"
])
df
_14
[
"
ideal_lot
"
]
=
(
TARGET_RUN_SEC
/
df
_14
[
"
cycletime_s
"
]).
round
().
astype
(
int
)
df
_14
[
"
opt_lot
"
]
=
df
_14
[
"
ideal_lot
"
].
clip
(
lower
=
df
_14
[
"
min
L
ot
"
],
upper
=
df
_14
[
"
max
L
ot
"
])
#
--- 4)
compute number of lots needed to meet annual demand ---
df
[
"
n_lots
"
]
=
(
df
[
"
Total
"
]
/
df
[
"
opt_lot
"
]).
apply
(
math
.
ceil
).
astype
(
int
)
# compute number of lots needed to meet annual demand ---
df
_14
[
"
n_lots
"
]
=
(
df
_14
[
"
Budget
"
]
/
df
_14
[
"
opt_lot
"
]).
apply
(
math
.
ceil
).
astype
(
int
)
# --- 5) report ---
print
(
df
[[
"
ID
"
,
"
Total
"
,
"
min_lot
"
,
"
max_lot
"
,
"
cycle_time_sec
"
,
"
ideal_lot
"
,
"
opt_lot
"
,
"
n_lots
"
]])
df_14
.
sum
(
axis
=
0
)
# compute ideal lot size, then clamp to [min_lot, max_lot]
df_15
[
"
ideal_lot
"
]
=
(
TARGET_RUN_SEC
/
df_15
[
"
cycletime_s
"
]).
round
().
astype
(
int
)
df_15
[
"
opt_lot
"
]
=
df_15
[
"
ideal_lot
"
].
clip
(
lower
=
df_15
[
"
minLot
"
],
upper
=
df_15
[
"
maxLot
"
])
# compute number of lots needed to meet annual demand ---
df_15
[
"
n_lots
"
]
=
(
df_15
[
"
Budget
"
]
/
df_15
[
"
opt_lot
"
]).
apply
(
math
.
ceil
).
astype
(
int
)
df_15
.
sum
(
axis
=
0
)
```
%% Output
ID Total min_lot max_lot cycle_time_sec ideal_lot opt_lot n_lots
0 0 957 400 5600 32.0 6188 5600 1
1 1 15136 4400 8000 36.0 5500 5500 3
2 2 36286 3960 10560 41.8 4737 4737 8
3 3 13705 2880 16000 84.0 2357 2880 5
4 4 36261 2000 7500 37.6 5266 5266 7
5 5 76744 2880 7040 46.9 4222 4222 19
6 6 4810 1700 6100 48.5 4082 4082 2
7 7 21412 1920 6960 59.5 3328 3328 7
8 8 8785 1280 5600 60.5 3273 3273 3
9 9 6934 1600 8800 58.5 3385 3385 3
10 10 4715 1200 2400 65.0 3046 2400 2
11 11 1691 72 1440 58.8 3367 1440 2
12 12 24519 1440 5640 59.6 3322 3322 8
13 13 19337 1600 6560 56.4 3511 3511 6
14 14 24014 1680 5680 61.6 3214 3214 8
15 15 33957 1040 4800 83.2 2380 2380 15
16 16 189 800 4800 50.0 3960 3960 1
17 17 21522 3696 7128 47.4 4177 4177 6
C:\Users\simone.miele\AppData\Local\Temp\ipykernel_6580\1335359789.py:6: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df_14["ideal_lot"] = (TARGET_RUN_SEC / df_14["cycletime_s"]).round().astype(int)
C:\Users\simone.miele\AppData\Local\Temp\ipykernel_6580\1335359789.py:7: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df_14["opt_lot"] = df_14["ideal_lot"].clip(lower=df_14["minLot"], upper=df_14["maxLot"])
C:\Users\simone.miele\AppData\Local\Temp\ipykernel_6580\1335359789.py:10: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df_14["n_lots"] = (df_14["Budget"] / df_14["opt_lot"]).apply(math.ceil).astype(int)
C:\Users\simone.miele\AppData\Local\Temp\ipykernel_6580\1335359789.py:15: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df_15["ideal_lot"] = (TARGET_RUN_SEC / df_15["cycletime_s"]).round().astype(int)
C:\Users\simone.miele\AppData\Local\Temp\ipykernel_6580\1335359789.py:16: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df_15["opt_lot"] = df_15["ideal_lot"].clip(lower=df_15["minLot"], upper=df_15["maxLot"])
C:\Users\simone.miele\AppData\Local\Temp\ipykernel_6580\1335359789.py:19: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df_15["n_lots"] = (df_15["Budget"] / df_15["opt_lot"]).apply(math.ceil).astype(int)
material-nr 261.855.00.1363.112.16.1363.115.16.1364.112.16...
TextMat Abzweig PE-HD 45G d56/50 mit ManschetteAbzweig...
Budget 331339
minLot 22856
maxLot 71768
roundvalue 2224
work_plan SPRI2315SPRI2315SPRI2315SPRI2315SPRI2315SPRI23...
changeover_H 23.264
cycletime_s 371.8
employeetime_s 264.327
Kavitt 14
Gebindem. 2224
ideal_lot 59061
opt_lot 48060
n_lots 75
dtype: object
%% Cell type:code id: tags:
```
python
```
...
...
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