From 815a13a6719e54c31f6e8130b3746d7523005955 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 15 Aug 2022 19:04:00 +0200 Subject: datafile: allow single-point domain size in some direction Used in cartoon configurations. --- datafile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3