diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-04-28 17:01:44 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-04-28 17:01:44 +0200 |
| commit | 74878db39a9247936d78def423c74c95ea088d00 (patch) | |
| tree | 97983f2f35cac0a27eac83e9578d761bb372c464 | |
| parent | 992e64cf93ee0c4312c15c43fdc302c0d3dee2f6 (diff) | |
| download | allocbench-74878db39a9247936d78def423c74c95ea088d00.tar.gz allocbench-74878db39a9247936d78def423c74c95ea088d00.zip | |
don't fail if NaN is in eval
| -rw-r--r-- | src/benchmark.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/benchmark.py b/src/benchmark.py index 971c4a8..4bab146 100644 --- a/src/benchmark.py +++ b/src/benchmark.py @@ -13,6 +13,10 @@ import src.globalvars from src.util import * +# This is useful when evaluating strings in the plot functionsi. str(np.NaN) == "nan" +nan = np.NaN + + class Benchmark (object): perf_allowed = None @@ -458,7 +462,9 @@ class Benchmark (object): norm_mean = eval(yval.format(**self.results["stats"][scale][perm]["mean"])) y_vals.append(mean / norm_mean) else: - y_vals.append(eval(yval.format(**self.results["stats"][allocator][perm]["mean"]))) + eval_dict = self.results["stats"][allocator][perm]["mean"] + eval_str = yval.format(**eval_dict) + y_vals.append(eval(eval_str)) plt.plot(x_vals, y_vals, marker='.', linestyle='-', |
