From bc7cd81f0deffcfb1c75907322cc0506744170e4 Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Thu, 7 Oct 2021 16:40:34 +0100 Subject: [PATCH] Bug fix empty extruded set with variable layers This would fail if the provided layers array has zero length (e.g. for boundary facets on an interior parallel domain) as numpy does not allow you to call min() on such an array. --- pyop2/types/set.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyop2/types/set.py b/pyop2/types/set.py index 7702d87f7..42ce266f9 100644 --- a/pyop2/types/set.py +++ b/pyop2/types/set.py @@ -305,7 +305,7 @@ def __init__(self, parent, layers): try: layers = utils.verify_reshape(layers, dtypes.IntType, (parent.total_size, 2)) self.constant_layers = False - if layers.min() < 0: + if layers.min(initial=0) < 0: raise ex.SizeTypeError("Bottom of layers must be >= 0") if any(layers[:, 1] - layers[:, 0] < 1): raise ex.SizeTypeError("Number of layers must be >= 0")