Skip to content

Commit bc7cd81

Browse files
committed
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.
1 parent 6286fc0 commit bc7cd81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyop2/types/set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def __init__(self, parent, layers):
305305
try:
306306
layers = utils.verify_reshape(layers, dtypes.IntType, (parent.total_size, 2))
307307
self.constant_layers = False
308-
if layers.min() < 0:
308+
if layers.min(initial=0) < 0:
309309
raise ex.SizeTypeError("Bottom of layers must be >= 0")
310310
if any(layers[:, 1] - layers[:, 0] < 1):
311311
raise ex.SizeTypeError("Number of layers must be >= 0")

0 commit comments

Comments
 (0)