imod.msw.MetaSwapModel.get_pkgkey#

MetaSwapModel.get_pkgkey(pkg_type: type[MetaSwapPackage], optional_package: bool = False) str | None[source]#

Get the package key for a package of type pkg_type. Returns the first occurrence of the package type.

Parameters:
  • pkg_type (type[MetaSwapPackage]) – Type of the package to get the key for.

  • optional_package (bool) – If True, the method will not raise an error if the package is not found. Method returns None in this case.

Returns:

The key of the package of type pkg_type.

Return type:

str