flopy
flopy copied to clipboard
bug: warning when calling get_alldata() of class HeadUFile for Unstructured MODFLOW-USG HeadUFile
Describe the bug The warning below is encountered when get_alldata is called. I also did a test. It will not work even a nodata value is specified.
C:\Anaconda\envs\py38\lib\site-packages\flopy\utils\datafile.py:573: DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
rv[rv == nodata] = np.nan
To Reproduce Call the function using some lines as below, hf_reg = bf.HeadUFile('a_USG_head_file.hds') h_all_reg = hf_reg.get_alldata()
Expected behavior A clear and concise description of what you expected to happen.
Screenshots
I cannot reproduce the reported warning — however HeadUFile.get_alldata()
fails on the previous line
https://github.com/modflowpy/flopy/blob/4e1d53ac3685d9027b1ced45749c9e20d8b701d5/flopy/utils/datafile.py#L578
when called on HeadUFile("<project root>/examples/data/unstructured/headu.githds")
due to array inhomogeneity
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (5, 3) + inhomogeneous part.
It seems like get_alldata()
either needs to be overridden for HeadUFile
to return a list instead of an array, which would change the semantics as compared to the base implementation in LayerFile
, or just be unsupported for USG head files. Am I thinking about this right @langevin-usgs @jdhughes-usgs ?