porespy
porespy copied to clipboard
`regions_to_network` breaks when there are no throats
I know this rarely happens, but there could be some use cases: suppose you have a sphere pack (non-overlapping), and you want to extract some geoemtrical information like pore size distribution, etc. Anyway, the root cause is that we assume throat.conns is non-empty.
Here's how to fix it: In porespy/networks/_getnet.py, if len(t_coords) is 0, the following changes need to be made:
t_coords = np.empty(shape=(0, 3))
net['throat.global_peak'] = np.empty(shape=(0, 3))
net['throat.conns'] = np.empty(shape=(0, 2), dtype=int)