From ab17a02c8f3fbd1cf9a29dc7a0d63355964cccc7 Mon Sep 17 00:00:00 2001 From: hassan-hijazi Date: Thu, 10 Oct 2024 10:32:29 -0600 Subject: [PATCH] [#123] trying to fix doc-tests --- docs/source/mods/opf/opf.rst | 2 +- src/gurobi_optimods/opf/violations.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/source/mods/opf/opf.rst b/docs/source/mods/opf/opf.rst index f3d9dc1e..e7e72688 100644 --- a/docs/source/mods/opf/opf.rst +++ b/docs/source/mods/opf/opf.rst @@ -276,7 +276,7 @@ solution information, as specified below. :options: +NORMALIZE_WHITESPACE >>> result['bus'][0] - {... 'Vm': 1.09..., 'Va': 0, ...} + {... 'Vm': 1.09..., 'Va': 0.0, ...} .. tab:: Branches diff --git a/src/gurobi_optimods/opf/violations.py b/src/gurobi_optimods/opf/violations.py index 5f07249d..50fbea1e 100644 --- a/src/gurobi_optimods/opf/violations.py +++ b/src/gurobi_optimods/opf/violations.py @@ -141,7 +141,10 @@ def grbderive_xtra_sol_values_from_voltages(alldata, model): var = item[1] row = model.getRow(constr) - sum = -constr.RHS + if constr.getAttr("QCRHS") is None: + sum = -constr.RHS + else: + sum = -constr.QCRHS leadcoeff = 0 for i in range(row.size()): v = row.getVar(i)