Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_record in MfList does not work #647

Closed
rubencalje opened this issue Sep 17, 2019 · 0 comments
Closed

add_record in MfList does not work #647

rubencalje opened this issue Sep 17, 2019 · 0 comments

Comments

@rubencalje
Copy link
Contributor

I think the add_record method of Mflist does not work as it is supposed to. The input seems to be reshaped in the wrong way somehow. For example:

ml = flopy.modflow.Modflow()
flopy.modflow.ModflowWel(ml)
ml.wel.stress_period_data.add_record(0,[0,0,1],[1.0])
print(ml.wel.stress_period_data[0])

produces 4 wells instead of 1:
[[(0, 0, 1, 1.) (0, 0, 1, 1.) (0, 0, 1, 1.) (0, 0, 1, 1.)]]

When I want to add a record to an already existing wel-object:

ml = flopy.modflow.Modflow()
flopy.modflow.ModflowWel(ml,stress_period_data={0:[[0,0,0,1.0],[0,0,1,2.0]]})
ml.wel.stress_period_data.add_record(0,[0,0,2],[3.0])

I get the following error:
IndexError: tuple index out of range

Am I using this method in a wrong way, or shall I try to fix it in a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant