summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/model.py8
-rwxr-xr-xlib/plotter.py2
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/model.py b/lib/model.py
index 8fefb0c..e77db01 100644
--- a/lib/model.py
+++ b/lib/model.py
@@ -177,6 +177,11 @@ class AnalyticModel:
)
self.fit_done = True
+ def get_by_param(self):
+ if not "by_param" in self.cache:
+ self.cache["by_param"] = by_name_to_by_param(self.by_name)
+ return self.cache["by_param"]
+
def __repr__(self):
names = ", ".join(self.by_name.keys())
return f"AnalyticModel<names=[{names}]>"
@@ -739,6 +744,9 @@ class PTAModel(AnalyticModel):
np.seterr("raise")
+ def get_by_param(self):
+ return self.by_param
+
def __repr__(self):
states = ", ".join(self.states)
transitions = ", ".join(self.transitions)
diff --git a/lib/plotter.py b/lib/plotter.py
index 85796cf..5609c46 100755
--- a/lib/plotter.py
+++ b/lib/plotter.py
@@ -198,7 +198,7 @@ def plot_param(
legend_sanitizer = re.compile(r"[^0-9a-zA-Z]+")
- for k, v in model.by_param.items():
+ for k, v in model.get_by_param().items():
if k[0] == state_or_trans:
other_param_key = (*k[1][:param_idx], *k[1][param_idx + 1 :])
if other_param_key not in by_other_param: