# autogenerated file, do not modify
{% import 'macros.jinja' as macros %}
{% set title = (name|title).title() %}
{% set description = name|description %}

from os import PathLike, curdir
from typing import Union

from flopy.mf6.data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator
from flopy.mf6.mfmodel import MFModel


class Modflow{{ title }}(MFModel):
    """
    {{ description }}

    Parameters
    ----------
    simulation : MFSimulation
        Simulation object that this model is a part of.
    modelname : str, default "model"
        Name of the model.
    model_nam_file : str, optional
        Relative path to the model name file from model working folder.
    version : str, default "mf6"
        Version of modflow.
    exe_name : str, default "mf6"
        Model executable name.
    model_rel_path : str or PathLike, default "." (curdir)
        Relative path of model folder to simulation folder.
{{ macros.docstrings(dfn|variables)|indent(4, first=true) }}
    **kwargs
        Extra keywords for :class:`flopy.mf6.mfmodel.MFModel`.

    """

    model_type = "{{ title.lower() }}"

    def __init__(
        self,
        simulation,
        modelname="model",
        model_nam_file=None,
        version="mf6",
        exe_name="mf6",
        model_rel_path=curdir,
{{ macros.init_params(dfn|variables, skip=name|skip_init)|indent(8, first=true) }}
        **kwargs,
    ):
        """Initialize Modflow{{ title }}."""
        super().__init__(
            simulation,
            model_type="{{ title.lower() }}6",
            modelname=modelname,
            model_nam_file=model_nam_file,
            version=version,
            exe_name=exe_name,
            model_rel_path=model_rel_path,
            **kwargs,
        )

        {% for statement in dfn|init(name) %}
        {{ statement }}
        {% endfor %}

    @classmethod
    def load(
        cls,
        simulation,
        structure,
        modelname="NewModel",
        model_nam_file="modflowtest.nam",
        version="mf6",
        exe_name="mf6",
        strict=True,
        model_rel_path=curdir,
        load_only=None,
    ):
        """
        Load an existing Modflow{{ title }} model.

        Parameters
        ----------
        simulation : MFSimulation
            Simulation object that this model is a part of.
        structure : MFModelStructure
            Structure of this type of model.
        modelname : str, default "NewModel"
            Name of the model.
        model_nam_file : str, default "modflowtest.nam"
            Relative path to the model name file from model working folder.
        version : str, default "mf6"
            Version of modflow.
        exe_name : str or PathLike, default "mf6"
            Model executable name or path.
        strict : bool, default True
            Strict mode when loading files.
        model_rel_path : str or PathLike, default "." (curdir)
            Relative path of model folder to simulation folder.
        load_only : list of str, optional
            Packages to load (e.g. ['btn', 'adv']). Default None
            means that all packages will be loaded.

        """
        return MFModel.load_base(
            cls,
            simulation,
            structure,
            modelname,
            model_nam_file,
            "{{ title.lower() }}6",
            version,
            exe_name,
            strict,
            model_rel_path,
            load_only,
        )
