Skip to content

Commit

Permalink
make modelsenss table less confusing
Browse files Browse the repository at this point in the history
  • Loading branch information
bqpd committed Apr 30, 2021
1 parent a23f30a commit 1d8a939
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gpkit/solution_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def msenss_table(data, _, **kwargs):
if "models" not in data.get("sensitivities", {}):
return ""
data = sorted(data["sensitivities"]["models"].items(),
key=lambda i: (-round(np.mean(i[1]), 1), i[0]))
key=lambda i: (-round(np.mean(i[1]), 4), i[0]))
lines = ["Model Sensitivities", "-------------------"]
if kwargs["sortmodelsbysenss"]:
lines[0] += " (sorts models in sections below)"
Expand All @@ -74,7 +74,7 @@ def msenss_table(data, _, **kwargs):
if (msenss < 0.1).all():
msenss = np.max(msenss)
if msenss:
msenssstr = "%6s" % ("<1e%i" % np.log10(msenss))
msenssstr = "%6s" % ("<1e%i" % max(-3, np.log10(msenss)))
else:
msenssstr = " =0 "
elif not msenss.shape:
Expand Down Expand Up @@ -803,7 +803,7 @@ def var_table(data, title, *, printunits=True, latex=False, rawlines=False,
if not sortmodelsbysenss:
msenss = 0
else: # sort should match that in msenss_table above
msenss = -round(np.mean(sortmodelsbysenss.get(model, 0)), 1)
msenss = -round(np.mean(sortmodelsbysenss.get(model, 0)), 4)
models.add(model)
b = bool(getattr(v, "shape", None))
s = k.str_without(("lineage", "vec"))
Expand Down

0 comments on commit 1d8a939

Please sign in to comment.