Skip to content

get_driver is actually a driver factory #371

@rleander73

Description

@rleander73

The get_driver method in driver.py (class driver) is a factory pattern returning an instance of a specific driver type based on a string in the config toml.
The selection of the returned instance type currently follows an if-else structurem but maybe better use of pydantic yields a cleaner, less explicit alternative. See imod_python and xugrid for instance.

  • string to type conversion automatically (?)
  • introspection(?)
  • get_driver outside the driver base class in a separate routine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions