The flopy.modpath.ParticleData class does not take a regular numpy array with three columns as input.
To reproduce:
import numpy as np
import flopy as fp
partlocs = np.array([(1, 1, 1),
(1, 1, 2)])
fp.modpath.ParticleData(partlocs=partlocs, structured=True)
The error message is ValueError: could not broadcast input array from shape (2,3) into shape (2,). The bug seems to be in mp7particledata.py on line 168, where the dtype of the input array is changed:
The
flopy.modpath.ParticleData
class does not take a regular numpy array with three columns as input.To reproduce:
The error message is
ValueError: could not broadcast input array from shape (2,3) into shape (2,)
. The bug seems to be in mp7particledata.py on line 168, where the dtype of the input array is changed:This conversion to a new
dtype
does not give the desired result as can be seen:gives
The correct conversion requires something (arguably ugly) as
which gives the desired
Incidentally, it appears that
flopy.modpath.ParticleData
also doesn't accept a list of lists such aswhich gives the same error. A list of tuples works fine, however.