# autogenerated file, do not modify

from os import PathLike, curdir
from typing import Union

from flopy.mf6.data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator
from flopy.mf6.mfpackage import MFChildPackages, MFPackage


class ModflowPrtoc(MFPackage):
    """
    ModflowPrtoc defines a OC package.

    Parameters
    ----------
    model
        Model that this package is a part of. Package is automatically
        added to model when it is initialized.
    loading_package : bool, default False
        Do not set this parameter. It is intended for debugging and internal
        processing purposes only.
    budget_filerecord : (budgetfile)
        * budgetfile : string
                name of the output file to write budget information.

    budgetcsv_filerecord : (budgetcsvfile)
        * budgetcsvfile : string
                name of the comma-separated value (CSV) output file to write budget summary
                information.  A budget summary record will be written to this file for each
                time step of the simulation.

    track_filerecord : (trackfile)
        * trackfile : string
                name of the binary output file to write tracking information.

    trackcsv_filerecord : (trackcsvfile)
        * trackcsvfile : string
                name of the comma-separated value (CSV) file to write tracking information.

    track_release : keyword
        keyword to indicate that particle tracking output is to be written when a
        particle is released
    track_exit : keyword
        keyword to indicate that particle tracking output is to be written when a
        particle exits a grid feature (e.g. model, cell)
    track_subfeature_exit : keyword
        keyword to indicate that particle tracking output is to be written when a
        particle exits a sub-grid-scale feature. such features are considered
        implementation details of the tracking algorithm employed for particular grid
        types, and reporting for exit events from such features is disabled by default.
    track_timestep : keyword
        keyword to indicate that particle tracking output is to be written at the end
        of each time step
    track_terminate : keyword
        keyword to indicate that particle tracking output is to be written when a
        particle terminates for any reason
    track_weaksink : keyword
        keyword to indicate that particle tracking output is to be written when a
        particle exits a weak sink (a cell which removes some but not all inflow from
        adjacent cells)
    track_usertime : keyword
        keyword to indicate that particle tracking output is to be written at user-
        specified times, provided as double precision values in the tracktimes block.
    track_dropped : keyword
        keyword to indicate that particle tracking output is to be written when a
        particle is dropped to the water table via dry_tracking_method drop.
    track_timesrecord : (track_times, times)
        * track_times : keyword
                keyword indicating tracking times will follow
        * times : [double precision]
                times to track, relative to the beginning of the simulation.

    track_timesfilerecord : (timesfile)
        * timesfile : string
                name of the tracking times file

    dev_dump_event_trace : keyword
        print a verbose particle tracking event trace to standard output
    ntracktimes : integer
        is the number of user-specified particle tracking times in the tracktimes
        block.
    tracktimes : [(time)]
        * time : double precision
                real value that defines the tracking time with respect to the simulation start
                time.

    saverecord : (save, rtype, ocsetting)
        * save : keyword
                keyword to indicate that information will be saved this stress period.
        * rtype : string
                type of information to save or print.  Can only be BUDGET.
        * ocsetting : keystring all first last frequency steps
                specifies the steps for which the data will be saved.

    printrecord : (print, rtype, ocsetting)
        * print : keyword
                keyword to indicate that information will be printed this stress period.
        * rtype : string
                type of information to save or print.  Can only be BUDGET.
        * ocsetting : keystring all first last frequency steps
                specifies the steps for which the data will be saved.


    filename : str or PathLike, optional
        Name or path of file where this package is stored.
    pname : str, optional
        Package name.
    **kwargs
        Extra keywords for :class:`flopy.mf6.mfpackage.MFPackage`.

    """

    budget_filerecord = ListTemplateGenerator(
        ("prt6", "oc", "options", "budget_filerecord")
    )
    budgetcsv_filerecord = ListTemplateGenerator(
        ("prt6", "oc", "options", "budgetcsv_filerecord")
    )
    track_filerecord = ListTemplateGenerator(
        ("prt6", "oc", "options", "track_filerecord")
    )
    trackcsv_filerecord = ListTemplateGenerator(
        ("prt6", "oc", "options", "trackcsv_filerecord")
    )
    track_timesrecord = ListTemplateGenerator(
        ("prt6", "oc", "options", "track_timesrecord")
    )
    track_timesfilerecord = ListTemplateGenerator(
        ("prt6", "oc", "options", "track_timesfilerecord")
    )
    tracktimes = ListTemplateGenerator(("prt6", "oc", "tracktimes", "tracktimes"))
    saverecord = ListTemplateGenerator(("prt6", "oc", "period", "saverecord"))
    printrecord = ListTemplateGenerator(("prt6", "oc", "period", "printrecord"))
    package_abbr = "prtoc"
    _package_type = "oc"
    dfn_file_name = "prt-oc.dfn"
    dfn = [
        ["header"],
        [
            "block options",
            "name budget_filerecord",
            "type record budget fileout budgetfile",
            "shape",
            "reader urword",
            "tagged true",
            "optional true",
        ],
        [
            "block options",
            "name budget",
            "type keyword",
            "shape",
            "in_record true",
            "reader urword",
            "tagged true",
            "optional false",
        ],
        [
            "block options",
            "name fileout",
            "type keyword",
            "shape",
            "in_record true",
            "reader urword",
            "tagged true",
            "optional false",
        ],
        [
            "block options",
            "name budgetfile",
            "type string",
            "preserve_case true",
            "shape",
            "in_record true",
            "reader urword",
            "tagged false",
            "optional false",
        ],
        [
            "block options",
            "name budgetcsv_filerecord",
            "type record budgetcsv fileout budgetcsvfile",
            "shape",
            "reader urword",
            "tagged true",
            "optional true",
        ],
        [
            "block options",
            "name budgetcsv",
            "type keyword",
            "shape",
            "in_record true",
            "reader urword",
            "tagged true",
            "optional false",
        ],
        [
            "block options",
            "name budgetcsvfile",
            "type string",
            "preserve_case true",
            "shape",
            "in_record true",
            "reader urword",
            "tagged false",
            "optional false",
        ],
        [
            "block options",
            "name track_filerecord",
            "type record track fileout trackfile",
            "shape",
            "reader urword",
            "tagged true",
            "optional true",
        ],
        [
            "block options",
            "name track",
            "type keyword",
            "shape",
            "in_record true",
            "reader urword",
            "tagged true",
            "optional false",
        ],
        [
            "block options",
            "name trackfile",
            "type string",
            "preserve_case true",
            "shape",
            "in_record true",
            "reader urword",
            "tagged false",
            "optional false",
        ],
        [
            "block options",
            "name trackcsv_filerecord",
            "type record trackcsv fileout trackcsvfile",
            "shape",
            "reader urword",
            "tagged true",
            "optional true",
        ],
        [
            "block options",
            "name trackcsv",
            "type keyword",
            "shape",
            "in_record true",
            "reader urword",
            "tagged true",
            "optional false",
        ],
        [
            "block options",
            "name trackcsvfile",
            "type string",
            "preserve_case true",
            "shape",
            "in_record true",
            "reader urword",
            "tagged false",
            "optional false",
        ],
        [
            "block options",
            "name track_release",
            "type keyword",
            "reader urword",
            "optional true",
        ],
        [
            "block options",
            "name track_exit",
            "type keyword",
            "reader urword",
            "optional true",
        ],
        [
            "block options",
            "name track_subfeature_exit",
            "type keyword",
            "reader urword",
            "optional true",
        ],
        [
            "block options",
            "name track_timestep",
            "type keyword",
            "reader urword",
            "optional true",
        ],
        [
            "block options",
            "name track_terminate",
            "type keyword",
            "reader urword",
            "optional true",
        ],
        [
            "block options",
            "name track_weaksink",
            "type keyword",
            "reader urword",
            "optional true",
        ],
        [
            "block options",
            "name track_usertime",
            "type keyword",
            "reader urword",
            "optional true",
        ],
        [
            "block options",
            "name track_dropped",
            "type keyword",
            "reader urword",
            "optional true",
        ],
        [
            "block options",
            "name track_timesrecord",
            "type record track_times times",
            "shape",
            "reader urword",
            "tagged true",
            "optional true",
            "removed 6.6.0",
        ],
        [
            "block options",
            "name track_times",
            "type keyword",
            "reader urword",
            "in_record true",
            "tagged true",
            "shape",
            "removed 6.6.0",
        ],
        [
            "block options",
            "name times",
            "type double precision",
            "shape (any1d)",
            "reader urword",
            "in_record true",
            "tagged false",
            "repeating true",
            "removed 6.6.0",
        ],
        [
            "block options",
            "name track_timesfilerecord",
            "type record track_timesfile timesfile",
            "shape",
            "reader urword",
            "tagged true",
            "optional true",
            "removed 6.6.0",
        ],
        [
            "block options",
            "name track_timesfile",
            "type keyword",
            "reader urword",
            "in_record true",
            "tagged true",
            "shape",
            "removed 6.6.0",
        ],
        [
            "block options",
            "name timesfile",
            "type string",
            "preserve_case true",
            "shape",
            "in_record true",
            "reader urword",
            "tagged false",
            "optional false",
            "removed 6.6.0",
        ],
        [
            "block options",
            "name dev_dump_event_trace",
            "type keyword",
            "reader urword",
            "optional true",
        ],
        [
            "block dimensions",
            "name ntracktimes",
            "type integer",
            "reader urword",
            "optional false",
        ],
        [
            "block tracktimes",
            "name tracktimes",
            "type recarray time",
            "shape (ntracktimes)",
            "reader urword",
        ],
        [
            "block tracktimes",
            "name time",
            "type double precision",
            "shape",
            "tagged false",
            "in_record true",
            "reader urword",
        ],
        [
            "block period",
            "name iper",
            "type integer",
            "block_variable true",
            "in_record true",
            "tagged false",
            "shape",
            "valid",
            "reader urword",
            "optional false",
        ],
        [
            "block period",
            "name saverecord",
            "type record save rtype ocsetting",
            "shape",
            "reader urword",
            "tagged false",
            "optional true",
        ],
        [
            "block period",
            "name save",
            "type keyword",
            "shape",
            "in_record true",
            "reader urword",
            "tagged true",
            "optional false",
        ],
        [
            "block period",
            "name printrecord",
            "type record print rtype ocsetting",
            "shape",
            "reader urword",
            "tagged false",
            "optional true",
        ],
        [
            "block period",
            "name print",
            "type keyword",
            "shape",
            "in_record true",
            "reader urword",
            "tagged true",
            "optional false",
        ],
        [
            "block period",
            "name rtype",
            "type string",
            "shape",
            "in_record true",
            "reader urword",
            "tagged false",
            "optional false",
        ],
        [
            "block period",
            "name ocsetting",
            "type keystring all first last frequency steps",
            "shape",
            "tagged false",
            "in_record true",
            "reader urword",
        ],
        [
            "block period",
            "name all",
            "type keyword",
            "shape",
            "in_record true",
            "reader urword",
        ],
        [
            "block period",
            "name first",
            "type keyword",
            "shape",
            "in_record true",
            "reader urword",
        ],
        [
            "block period",
            "name last",
            "type keyword",
            "shape",
            "in_record true",
            "reader urword",
        ],
        [
            "block period",
            "name frequency",
            "type integer",
            "shape",
            "tagged true",
            "in_record true",
            "reader urword",
        ],
        [
            "block period",
            "name steps",
            "type integer",
            "shape (<nstp)",
            "tagged true",
            "in_record true",
            "reader urword",
        ],
    ]

    def __init__(
        self,
        model,
        loading_package=False,
        budget_filerecord=None,
        budgetcsv_filerecord=None,
        track_filerecord=None,
        trackcsv_filerecord=None,
        track_release=None,
        track_exit=None,
        track_subfeature_exit=None,
        track_timestep=None,
        track_terminate=None,
        track_weaksink=None,
        track_usertime=None,
        track_dropped=None,
        track_timesrecord=None,
        track_timesfilerecord=None,
        dev_dump_event_trace=None,
        ntracktimes=None,
        tracktimes=None,
        saverecord=None,
        printrecord=None,
        filename=None,
        pname=None,
        **kwargs,
    ):
        """Initialize ModflowPrtoc."""
        super().__init__(
            parent=model,
            package_type="oc",
            filename=filename,
            pname=pname,
            loading_package=loading_package,
            **kwargs,
        )

        self.budget_filerecord = self.build_mfdata(
            "budget_filerecord", budget_filerecord
        )
        self.budgetcsv_filerecord = self.build_mfdata(
            "budgetcsv_filerecord", budgetcsv_filerecord
        )
        self.track_filerecord = self.build_mfdata("track_filerecord", track_filerecord)
        self.trackcsv_filerecord = self.build_mfdata(
            "trackcsv_filerecord", trackcsv_filerecord
        )
        self.track_release = self.build_mfdata("track_release", track_release)
        self.track_exit = self.build_mfdata("track_exit", track_exit)
        self.track_subfeature_exit = self.build_mfdata(
            "track_subfeature_exit", track_subfeature_exit
        )
        self.track_timestep = self.build_mfdata("track_timestep", track_timestep)
        self.track_terminate = self.build_mfdata("track_terminate", track_terminate)
        self.track_weaksink = self.build_mfdata("track_weaksink", track_weaksink)
        self.track_usertime = self.build_mfdata("track_usertime", track_usertime)
        self.track_dropped = self.build_mfdata("track_dropped", track_dropped)
        self.track_timesrecord = self.build_mfdata(
            "track_timesrecord", track_timesrecord
        )
        self.track_timesfilerecord = self.build_mfdata(
            "track_timesfilerecord", track_timesfilerecord
        )
        self.dev_dump_event_trace = self.build_mfdata(
            "dev_dump_event_trace", dev_dump_event_trace
        )
        self.ntracktimes = self.build_mfdata("ntracktimes", ntracktimes)
        self.tracktimes = self.build_mfdata("tracktimes", tracktimes)
        self.saverecord = self.build_mfdata("saverecord", saverecord)
        self.printrecord = self.build_mfdata("printrecord", printrecord)

        self._init_complete = True
