From 12cdea62b14c723b9330b7d3eaacde6113b1ac8f Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Wed, 9 Oct 2019 13:15:23 -0400 Subject: [PATCH] lint --- gpkit/globals.py | 4 ++-- gpkit/nomials/math.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gpkit/globals.py b/gpkit/globals.py index 75135744a..d54b9e669 100644 --- a/gpkit/globals.py +++ b/gpkit/globals.py @@ -27,8 +27,8 @@ def load_settings(path=None, firstattempt=True): except IOError: settings_ = {"installed_solvers": [""]} if (settings_["installed_solvers"] == [""] - or ("mosek" in settings_["installed_solvers"] - and "mosek_version" not in settings_)): + or ("mosek" in settings_["installed_solvers"] + and "mosek_version" not in settings_)): if firstattempt: print("Found no installed solvers, beginning a build.") build() diff --git a/gpkit/nomials/math.py b/gpkit/nomials/math.py index 3f63866d4..09849706c 100644 --- a/gpkit/nomials/math.py +++ b/gpkit/nomials/math.py @@ -375,6 +375,7 @@ def mono_approximation(self, x0): class ScalarSingleEquationConstraint(SingleEquationConstraint): "A SingleEquationConstraint with scalar left and right sides." nomials = [] + sgp_parent = None def __init__(self, left, oper, right): lr = [left, right] @@ -416,7 +417,6 @@ class PosynomialInequality(ScalarSingleEquationConstraint): """ feastol = 1e-3 - sgp_parent = None relax_sensitivity = None # NOTE: follows .check_result's max default, but 1e-3 seems a bit lax... @@ -607,7 +607,8 @@ def sens_from_dual(self, la, nu, result): if self.sgp_parent: self.sgp_parent.relax_sensitivity = self.relax_sensitivity if getattr(self.sgp_parent, "sgp_parent", None): - self.sgp_parent.sgp_parent.relax_sensitivity = self.relax_sensitivity + self.sgp_parent.sgp_parent.relax_sensitivity = \ + self.relax_sensitivity var_senss = {} for var in self.varkeys: for i, m in enumerate(self.unsubbed):