porespy icon indicating copy to clipboard operation
porespy copied to clipboard

_parse_pad_width fails when given list of lists

Open ma-sadeghi opened this issue 3 years ago • 2 comments

Try with pw = [[0, 0], [0, 0], [3, 3]].

ma-sadeghi avatar Aug 10 '21 16:08 ma-sadeghi

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?

jgostick avatar Mar 18 '22 20:03 jgostick

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)

ma-sadeghi avatar Mar 27 '22 11:03 ma-sadeghi