[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "imod"
dynamic = ["version"]
requires-python = ">=3.10"
authors = [{ name = "Deltares", email = "huite.bootsma@deltares.nl" }, ]
maintainers = [{ name = "Deltares", email = "huite.bootsma@deltares.nl" }]
description = "Make massive MODFLOW models!"
readme = "README.rst"
license = { file = "LICENSE" }
keywords = ["imod", "modflow", "groundwater modeling"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Science/Research",
    "Topic :: Scientific/Engineering :: Hydrology",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: Implementation :: CPython",
    "Topic :: Scientific/Engineering"
]
dependencies = [
    "affine",
    "cftime >=1",
    "dask",
    "fastcore",
    "Jinja2",
    "loguru",
    "matplotlib",
    "numba",
    "numpy",
    "pandas",
    "pooch",
    "scipy",
    "tomli >= 1.1.0",
    "tomli_w",
    "toolz",
    "tqdm",
    "xarray >=2023.08.0",
    "xugrid >=0.9.0",
]

[project.urls]
Homepage = "https://github.com/Deltares/imod-python"
Documentation = "https://deltares.github.io/imod-python/"
Repository = "https://github.com/Deltares/imod-python.git"
"Bug Tracker" = "https://github.com/Deltares/imod-python/issues"
Changelog = "https://github.com/Deltares/imod-python/blob/master/docs/api/changelog.rst"

[project.optional-dependencies]
all = [
    "bottleneck",
    "contextily >=1",
    "cytoolz",
    "geopandas",
    "pyvista",
    "rasterio >=1",
    "rioxarray",
    "shapely >=1.8",
    "zarr",
]

[tool.coverage.report]
exclude_lines = [
    "pragma: no cover",
]

[tool.ruff.lint]
select = ["C4", "E", "F", "I", "PD"]
ignore = [
    "E501", # line-too-long. This rule can't be fullfilled by the ruff formatter. The same behavior as black.
    "PD003",
    "PD004",
    "PD901",
    "PD011",
    "PD013",
    "PD015",
]
ignore-init-module-imports = true

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.per-file-ignores]
"./docs/conf.py" = ["F401"]
"__init__.py" = ["F401"]
"conftest.py" = ["F401"]
"test_examples.py" = ["F401"]
"examples/*" = ["E402"]

[tool.mypy]
files = [
    "imod/logging/**/**.py",
    "imod/mf6/**/**.py",
    "imod/msw/**/**.py",
    "imod/prepare/**/**.py",
    "imod/select/**/**.py",
    "imod/typing/**/**.py",
    "imod/util/**/**.py",
]
follow_imports = "normal"
strict = true

# Strongly recommend enabling this one as soon as you can
check_untyped_defs = false

# These shouldn't be too much additional work, but may be tricky to
# get passing if you use a lot of untyped libraries
disallow_untyped_decorators = false
disallow_any_generics = false

# These next few are various gradations of forcing use of type annotations
disallow_untyped_calls = false
disallow_incomplete_defs = false
disallow_untyped_defs = false

# This one isn't too hard to get passing, but return on investment is lower
no_implicit_reexport = false

# This one can be tricky to get passing if you use a lot of untyped libraries
warn_return_any = false

[[tool.mypy.overrides]]
module = [
    "affine.*",
    "bottleneck.*",
    "cftime.*",
    "contextily.*",
    "dateutil.*",
    "flopy.*",
    "fastcore.*",
    "geopandas.*",
    "matplotlib.*",
    "mpl_toolkits.*",
    "numba.*",
    "osgeo.*",
    "pandas.*",
    "pooch.*",
    "pyproj.*",
    "rasterio.*",
    "scipy.*",
    "shapely.*",
    "tomllib.*",
    "tqdm.*",
    "vtk.*",
    "xugrid.*",
]
ignore_missing_imports = true

[tool.pytest.ini_options]
markers = [
    "example: marks test as example (deselect with '-m \"not example\"')",
]

[tool.hatch.version]
path = "imod/__init__.py"

[tool.hatch.build.targets.sdist]
only-include = ["imod"]