I'm not sure if the following is a bug or, instead, a consequence of something implicitly understood about use of np.ndarrays.
I believe that the following behavior is new to 3.5.0 as I'm experiencing this error in a script that worked on a previous machine (and earlier version of flopy):
>>> flopy.__version__
'3.5.0.dev0'
>>> np.__version__
'1.26.0'
For partlocs as a 1D np.ndarray (e.g., partlocs.shape = (38890, )
npd = flopy.modpath.ParticleData(partlocs=partlocs, drape=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\wzell\projects\wzell\flopy\flopy\modpath\mp7particledata.py", line 174, in __init__
partlocs = unstructured_to_structured(partlocs, dtype=dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\wzell\miniforge-pypy3\envs\ngwm_wq1.0\Lib\site-packages\numpy\lib\recfunctions.py", line 1153, in unstructured_to_structured
raise ValueError('The length of the last dimension of arr must '
ValueError: The length of the last dimension of arr must be equal to the number of fields in dtype
Recasting partlocs to (i) an explicit 1D np.ndarray or (ii) a list work as before:
I'm not sure if the following is a bug or, instead, a consequence of something implicitly understood about use of np.ndarrays. I believe that the following behavior is new to 3.5.0 as I'm experiencing this error in a script that worked on a previous machine (and earlier version of flopy):
For
partlocs
as a 1D np.ndarray (e.g.,partlocs.shape
= (38890, )results in the following error:
Recasting
partlocs
to (i) an explicit 1D np.ndarray or (ii) a list work as before: