Menu

Find the Bottleneck in a Packing Line with 20 Lines of Python
📰

Find the Bottleneck in a Packing Line with 20 Lines of Python

DEV Community: datascience·PackForge Industries·3 days ago
#Jffze6z3
#devtodatascience#science#devto#dev#line
Reading 0:00
15s threshold

A packing line is just a pipeline: fill, seal, label, carton, tape, strap, wrap. Like any pipeline, it runs at the speed of its slowest stage. If you have ever profiled code, you already know how to think about this.

Normalise every stage to the same unit

Machine specs come in mixed units: cartons per minute, cartons per hour, metres per minute of belt speed. Convert everything to units per hour first.

def per_hour ( value , unit , carton_length_mm = None , gap_mm = 0 ): if unit == " per_min " : return value * 60 if unit == " per_hour " : return value if unit == " m_per_min " : # belt speed -> cartons, needs carton length pitch_m = ( carton_length_mm + gap_mm ) / 1000 return value / pitch_m * 60 raise ValueError ( unit )

Enter fullscreen mode

Exit fullscreen mode

The belt-speed case matters: a carton sealer rated at 24 m/min does not seal 24 cartons a minute.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.