diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-08-15 19:04:00 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-08-15 19:04:00 +0200 |
commit | 815a13a6719e54c31f6e8130b3746d7523005955 (patch) | |
tree | 82c2dfd1129185398566a00de431bd0ddad07830 | |
parent | 610911aaa220a5c3e080ec0d530cb49fdad403d2 (diff) |
datafile: allow single-point domain size in some direction
Used in cartoon configurations.
-rw-r--r-- | datafile.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/datafile.py b/datafile.py index b7e437b..0436e2a 100644 --- a/datafile.py +++ b/datafile.py @@ -136,7 +136,10 @@ class _DataSet(object): # get the spatial step sizes step = [None] * nb_dims for i in range(nb_dims): - step[i] = abs(data[0].layout.coords[i][1] - data[0].layout.coords[i][0]) + if len(data[0].layout.coords[i]) > 1: + step[i] = abs(data[0].layout.coords[i][1] - data[0].layout.coords[i][0]) + else: + step[i] = 1.0 # calculate the extents of the result coord_max = [None] * nb_dims |