From 4b257249193ddc1277b1684c1702bea05a4be1cd Mon Sep 17 00:00:00 2001 From: David Ketcheson Date: Sat, 23 Feb 2019 22:38:49 -0800 Subject: [PATCH] Properly initialize GaugeSolution if gauge has only one reading. --- src/pyclaw/gauges.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pyclaw/gauges.py b/src/pyclaw/gauges.py index af6966ab9..48cef2b2b 100644 --- a/src/pyclaw/gauges.py +++ b/src/pyclaw/gauges.py @@ -135,6 +135,8 @@ def read(self, gauge_id, path=None, use_pandas=False): self.q = pandas.DataFrame() else: data = numpy.loadtxt(gauge_path, comments="#") + if len(x.shape) == 1: + x = np.array([x]) self.level = data[:, 0].astype(numpy.int64) self.t = data[:, 1] self.q = data[:, 2:].transpose()