Skip to content

Commit

Permalink
Bug fix empty extruded set with variable layers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
connorjward committed Oct 7, 2021
1 parent 6286fc0 commit bc7cd81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyop2/types/set.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit bc7cd81

Please sign in to comment.