Skip to content

pySWATPlus.types

ModifyType: typing.TypeAlias = list[dict[str, typing.Any]] module-attribute

A list of dictionaries specifying parameter changes in the calibration.cal file. Each dictionary contain the following keys:

  • name (str): Required. Name of the parameter in the cal_parms.cal file.
  • change_type (str): Required. Type of change to apply. Must be one of absval, abschg, or pctchg.
  • value (float): Required. Value of the parameter.
  • units (Iterable[int]): Optional. List of unit IDs to which the parameter change should be constrained.
  • conditions (dict[str, list[str]]): Optional. Conditions to apply when changing the parameter. Supported keys include 'hsg', 'texture', 'plant', and 'landuse', each mapped to a list of allowed values.
Example
parameters = [
    {
        'name': 'cn2',
        'change_type': 'pctchg',
        'value': 50,
    },
    {
        'name': 'perco',
        'change_type': 'absval',
        'value': 0.5,
        'conditions': {'hsg': ['A']}
    },
    {
        'name': 'bf_max',
        'change_type': 'absval',
        'value': 0.3,
        'units': range(1, 194)
    }
]

BoundType: typing.TypeAlias = list[dict[str, typing.Any]] module-attribute

A list of dictionaries defining parameter configurations for sensitivity simulations. Each dictionary contain the following keys:

  • name (str): Required. Name of the parameter in the cal_parms.cal file.
  • change_type (str): Required. Type of change to apply. Must be one of absval, abschg, or pctchg.
  • lower_bound (float): Required. Lower bound for the parameter.
  • upper_bound (float): Required. Upper bound for the parameter.
  • units (Iterable[int]): Optional. List of unit IDs to which the parameter change should be constrained.
  • conditions (dict[str, list[str]]): Optional. Conditions to apply when changing the parameter. Supported keys include 'hsg', 'texture', 'plant', and 'landuse', each mapped to a list of allowed values.
Example
parameters = [
    {
        'name': 'cn2',
        'change_type': 'pctchg',
        'lower_bound': 25,
        'upper_bound': 75,
    },
    {
        'name': 'perco',
        'change_type': 'absval',
        'lower_bound': 0,
        'upper_bound': 1,
        'conditions': {'hsg': ['A']}
    },
    {
        'name': 'bf_max',
        'change_type': 'absval',
        'lower_bound': 0.1,
        'upper_bound': 2.0,
        'units': range(1, 194)
    }
]