From 4439389794a57b5d65e0b769d0c5b5bfca53cfc9 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Sun, 12 May 2024 16:06:27 +0300 Subject: [PATCH] clear lists, bump dev version --- pyproject.toml | 2 +- src/highspy/highs.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b7a02c2fc2..9d7bbc63c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "scikit_build_core.build" [project] name = "highspy" -version = "1.7.1.dev1" +version = "1.7.1.dev2" description = "A thin set of pybind11 wrappers to HiGHS" authors = [{ name = "HiGHS developers", email = "highsopt@gmail.com" }] readme = "README.md" diff --git a/src/highspy/highs.py b/src/highspy/highs.py index 98ea5d6506..9c2e3a137c 100644 --- a/src/highspy/highs.py +++ b/src/highspy/highs.py @@ -121,6 +121,8 @@ def update(self): self._batch = highs_batch(self) print("DEBUG update(self): On exit - current_batch_size = ", len(self._batch.obj)) + self._vars.clear() + self._cons.clear() def val(self, var): return super().getSolution().col_value[var.index] @@ -218,6 +220,7 @@ def allConstrDuals(self): # highspy binding to Highs::addVar def addVariable(self, lb = 0, ub = kHighsInf, obj = 0, type=HighsVarType.kContinuous, name = None, update = False): print("\nDEBUG addVariable: name = ", name, "; obj = ", obj, "; lb = ", lb, "; ub = ", ub, " with update = ", update) + var = self._batch.add(obj, lb, ub, type, name, self) self._vars.append(var) # No longer acumulate a batch of variables so that addVariable