Skip to content

add_record in MfList does not work #647

@rubencalje

Description

@rubencalje

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions