porespy
porespy copied to clipboard
_parse_pad_width fails when given list of lists
Try with pw = [[0, 0], [0, 0], [3, 3]]
.
This works for me. I also had the feeling that this function wasn't working but it now is (I closed a related issue today). The above pw
works fine and produces: [[0, 0], [0, 0], [3, 3]], which is the input since you specified all the axes explicitly. Before I close this, can try to reproduce the error?
Passing a simple list works:
import porespy as ps
pw = [0, 0, 3]
ps.networks._snow2._parse_pad_width(pw, shape=[100, 100, 100])
Out[16]:
array([[0, 0],
[0, 0],
[3, 3]])
whereas passing a list of list produces dtype=object
, which is not liked by porespy.
import porespy as ps
pw = [[0, 0], [0, 0], [3, 3]]
ps.networks._snow2._parse_pad_width(pw, shape=[100, 100, 100])
Out[14]:
array([[0, 0],
[0, 0],
[3, 3]], dtype=object)