From 5c2b067c5ea34466be921054f1be066c2241347b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20M=2E=20L=C3=B3pez?= <12429461+FelipeMLopez@users.noreply.github.com> Date: Thu, 3 Nov 2022 11:05:34 +0100 Subject: [PATCH] Update to allow using previous bounds with categories. With this update we can use bounds from previous runs with categories. This allows, for example, to reduce the iteration space when using categories. For this it's necessary to have somehow saved the bounds resulting form previous runs of the optimizer. --- lipo/optimizer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lipo/optimizer.py b/lipo/optimizer.py index 383d2a8..eae2e3c 100644 --- a/lipo/optimizer.py +++ b/lipo/optimizer.py @@ -108,6 +108,9 @@ def __init__( self.lower_bounds = lower_bounds self.upper_bounds = upper_bounds for name, cats in self.categories.items(): + # we dont need to check both, lower and upper bounds + if name in lower_bounds: + continue self.lower_bounds[name] = 0 self.upper_bounds[name] = len(cats) - 1