Description
Description:
I am encountering an issue when using FloPy to create a MODFLOW CHD (Constant Head) package.
When the cellid parameter is passed as a 3-item array or list (e.g., [int, int, int]), FloPy accepts the input but fails to correctly export it in the resulting MODFLOW file.
Here’s a brief summary of the problem:
Input: I provide the cellid as a 3-item array or list, representing the cell coordinates.
Expected behavior: The cellid should be exported in the MODFLOW input file as a tuple, correctly specifying the cell.
Actual behavior: The cellid is ignored during the export, and it doesn't appear in the final MODFLOW input file. This results in an incomplete or incorrect CHD package.
I believe this is a bug where FloPy is accepting the cellid array but not properly converting or exporting it when writing the file. This happens even though FloPy can accept the input in array format but doesn't include the cellid in the exported file.
Steps to reproduce:
Create a ModflowChd object in FloPy.
Pass cellid as a 3-item array (e.g., [i, j, k]).
Export the model and check the resulting MODFLOW file.
Environment:
FloPy version: [3.8.2]
Python version: [Python 3.12.2]
Operating system: [MacOS, 15.3.2 (24D81)]
Potential Solution:
I suspect that FloPy is not handling the cellid array correctly during the export process. It might be worth ensuring that cellid is always converted to a tuple when writing to the MODFLOW file. Also for the other boundary packages.
(Additionaly, I advocate that all stress_period_data can be provided as dicts of structured arrays with the proper dtype, so that both the user and flopy know what is entered, which is probably the most rigorous, concise and pythonic way to provide these data.)