Coverage for C:\src\imod-python\imod\mf6\api_package.py: 100%
11 statements
« prev ^ index » next coverage.py v7.5.1, created at 2024-05-08 14:15 +0200
« prev ^ index » next coverage.py v7.5.1, created at 2024-05-08 14:15 +0200
1import numpy as np
3from imod.mf6.package import Package
4from imod.schemata import (
5 DTypeSchema,
6)
8_init_schemata = {
9 "maxbound": [DTypeSchema(np.integer)],
10}
13class ApiPackage(Package):
14 """
15 The API package can be used to interact with the dll-version of Modflow (libMF6.dll).
16 libMF6 implement the XMI api, which can be used among other things to get
17 or set internal MF6 arrays mid-simulation.
18 For more information, see:
20 https://doi.org/10.1016/j.envsoft.2021.105257
21 https://modflow6.readthedocs.io/en/stable/_mf6io/gwf-api.html
22 https://modflow6.readthedocs.io/en/stable/_mf6io/gwt-api.html
24 Parameters
25 ----------
26 maxbound: int
27 The number of cells for which information will be queried or set with api calls.
28 print_input: ({True, False}, optional)
29 keyword to indicate that the list of constant head information will
30 be written to the listing file immediately after it is read. Default is
31 False.
32 print_flows: ({True, False}, optional)
33 Indicates that the list of constant head flow rates will be printed to
34 the listing file for every stress period time step in which "BUDGET
35 PRINT" is specified in Output Control. If there is no Output Control
36 option and PRINT FLOWS is specified, then flow rates are printed for the
37 last time step of each stress period.
38 Default is False.
39 save_flows: ({True, False}, optional)
40 Indicates that constant head flow terms will be written to the file
41 specified with "BUDGET FILEOUT" in Output Control. Default is False.
43 .. note::
44 This package can be added to both flow and transport models.
45 """
47 _pkg_id = "api"
48 _template = Package._initialize_template(_pkg_id)
50 def __init__(
51 self,
52 maxbound: int,
53 print_input: bool = False,
54 print_flows: bool = False,
55 save_flows: bool = False,
56 validate: bool = True,
57 ):
58 dict_dataset = {
59 "maxbound": maxbound,
60 "print_input": print_input,
61 "print_flows": print_flows,
62 "save_flows": save_flows,
63 }
64 super().__init__(dict_dataset)
65 self._validate_init_schemata(validate)