Skip to content

Support passing model(s) to solver packages #285

@wpbonelli

Description

@wpbonelli

Suggested by @mbakker7 in modflowpy/flopy#2355 and discussed further in modflowpy/flopy#2354. Though solvers live at simulation scope they are associated with (one or more) models. In flopy 3.x the registration step is awkward. It would be nice to be able to create this association by passing model(s) to the solver initializer. The models' association with a simulation then being transferred to the solver instead of requiring separate registration or both sim and model at solver init.

Currently we support a syntax which is kind of as requested, but still awkward as it expects string model names, not models themselves.

ims = Ims(models=[gwf_name])

Maybe worth supporting both/either? Like

gwf = Gwf(name="mymodel", ...)
ims = Ims(models=[gwf], ...) # by model object
ims = Ims(models=["mymodel"], ...) # by model name

Loosely related to #259

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfrontendRelated to the user-facing APIquestionInformation or decisions requiredrequirementCore requirement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions