Beispiel #1
0
 def test_basic(self):
     cf = CutFinder(finals=[50, 49], stocks=[100])
     self.assertEqual(cf.finals.used_boards, [50, 49])
     self.assertEqual(cf.finals.unused_boards, list())
     self.assertEqual(cf.stocks.unused_boards, list())
Beispiel #2
0
 def test_kerf(self):
     cf = CutFinder(finals=[49.5, 49.5], stocks=[100], kerf=1)
     self.assertEqual(cf.finals.unused_boards, list())
     self.assertEqual(cf.finals.used_boards, [49.5, 49.5])
     self.assertEqual(cf.stocks.unused_boards, list())
     self.assertEqual(cf.stocks.used_boards, [100])
Beispiel #3
0
 def test_final_longer_than_stock(self):
     cf = CutFinder(finals=[100], stocks=[99])
     self.assertEqual(cf.finals.unused_boards, [100])
     self.assertEqual(cf.finals.used_boards, list())
     self.assertEqual(cf.stocks.unused_boards, [99])
     self.assertEqual(cf.stocks.used_boards, list())
Beispiel #4
0
 def test_prioritizes_least_waste(self):
     cf = CutFinder(finals=[50, 49, 23], stocks=[100])
     self.assertEqual(cf.finals.unused_boards, [23])
     self.assertEqual(cf.finals.used_boards, [50, 49])
     self.assertEqual(cf.stocks.unused_boards, list())
Beispiel #5
0
 def test_largest_remainder(self):
     cf = CutFinder(finals=[50], stocks=[100, 200])
     self.assertEqual(cf.finals.used_boards, [50])
     self.assertEqual(cf.finals.unused_boards, list())
     self.assertEqual(cf.stocks.used_boards, [100])
     self.assertEqual(cf.stocks.unused_boards, [200])
Beispiel #6
0
def main():
    """entry point for command line execution"""
    CutFinder(*map(parse_arg, sys.argv[1:]))