Skip to content

Commit

Permalink
fix sankey for tautological constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
bqpd committed Aug 14, 2020
1 parent 5c162dd commit e65d291
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gpkit/interactive/sankey.py
Expand Up @@ -119,8 +119,12 @@ def link(self, cset, target, var, *, labeled=False, subarray=False):
else:
if var is None and cset in self.csenss:
total_sens = -abs(self.csenss[cset]) or -EPS
elif var is not None and var.key in cset.v_ss:
total_sens = cset.v_ss[var.key] or EPS
elif var is not None:
if cset.v_ss is None:
if var.key in cset.varkeys:
total_sens = EPS
elif var.key in cset.v_ss:
total_sens = cset.v_ss[var.key] or EPS
if not labeled:
cstr = cset.str_without(["lineage", "units"])
label = cstr if len(cstr) <= 30 else "%s ..." % cstr[:30]
Expand Down

0 comments on commit e65d291

Please sign in to comment.