content: [build-system]
  requires = ["poetry-core>=1.0.0"]
  build-backend = "poetry.core.masonry.api"
  
  [tool.poetry]
  name = "meteodata-lab"
  version = "0.6.0"
  description = "A data post-processing framework on the basis of xarray."
  readme = "README.md"
  keywords = ["Icon", "Data Processing"]
  classifiers = [
      "Development Status :: 2 - Pre-Alpha",
      "Intended Audience :: Developers",
      "Natural Language :: English",
      "Programming Language :: Python :: 3",
      "Programming Language :: Python :: 3.10",
  ]
  authors = [
      "Carlos Osuna <carlos.osuna@meteoswiss.ch>",
      "Petra Baumann <petra.baumanna@meteoswiss.ch>",
      "Nina Burgdorfer <nina.burgdorfer@meteoswiss.ch>",
      "Victoria Cherkas <victoria.cherkas@meteoswiss.ch>",
      "Christian Kanesan <christian.kanesan@meteoswiss.ch>",
      "Tobias Wicky <tobias.wicky@meteoswiss.ch>",
  ]
  packages = [
      { include = "meteodatalab", from = "src" },
  ]
  
  [tool.poetry.dependencies]
  python = ">=3.10,<3.13"
  click = "^8.1.7"
  earthkit-data = { version = ">=0.11,<1", extras = ["covjsonkit"] }
  earthkit-meteo = ">=0.4.0"
  eccodes = ">=2.38,<2.40"
  eccodes-cosmo-resources-python = "~2.38"
  numpy = ">=1.26.4,<2.4.0"
  polytope-client = { version = "^0.7.4", optional = true }
  pydantic = "*"
  pyproj = { version = "^3.6.1", optional = true }
  pyyaml = "^6.0.1"
  rasterio = { version = "^1.3.10", optional = true }
  scipy = { version = "^1.13", optional = true }
  setuptools = "*"
  xarray = ">=2024"
  
  [tool.poetry.extras]
  # fdb = ["pyfdb"]
  polytope = ["polytope-client"]
  regrid = ["pyproj", "rasterio", "scipy"]
  
  [tool.poetry.group.dev.dependencies]
  black = "*"
  codespell = "*"
  flake8 = "*"
  Flake8-pyproject = "*"
  ipykernel = "*"
  isort = "*"
  mypy = "*"
  pandas-stubs = "*"
  pre-commit = "*"
  pydocstyle = "*"
  pyfdb = { url = "https://github.com/ecmwf/pyfdb/archive/refs/tags/0.0.3.zip" }
  pytest = "*"
  rstcheck = { version = "*", extras = ["sphinx"] }
  types-requests = "*"
  types-PyYAML = "*"
  
  [tool.poetry.urls]
  source = "https://github.com/MeteoSwiss/meteodata-lab"
  documentation = "https://meteoswiss.github.io/meteodata-lab/"
  
  [tool.poetry.scripts]
  # Format: <command> = "<package>.<module>:<function>"
  meteodata-lab = "meteodatalab.cli:main"
  
  [tool.pytest.ini_options]
  testpaths = ["tests"]
  addopts = [
      "-ra",
      "--pdbcls=IPython.terminal.debugger:TerminalPdb",
      "--tb=short",
      # "--cov=meteodatalab",
      # "--mypy",
  ]
  markers = [
      "ifs",   # marks tests that use IFS grib definitions
      "cosmo", # marks tests that use COSMO grib definitions
      "data",  # marks tests that depend on specific test data
  ]
  
  [tool.black]
  
  [tool.isort]
  default_section = "THIRDPARTY"
  profile = "black"
  # Headings
  import_heading_stdlib = "Standard library"
  import_heading_thirdparty = "Third-party"
  import_heading_firstparty = "First-party"
  import_heading_localfolder = "Local"
  # Known modules to avoid misclassification
  known_standard_library = [
      # Add standard library modules that may be misclassified by isort
  ]
  known_third_party = [
      # Add third-party modules that may be misclassified by isort
  ]
  known_first_party = [
      # Add first-party modules that may be misclassified by isort
      "meteodatalab",
  ]
  
  [tool.mypy]
  plugins = ["pydantic.mypy"]
  
  [[tool.mypy.overrides]]
  # Note: Only globally ignore missing imports as a matter of last resort!
  # See https://blog.wolt.com/engineering/2021/09/30/professional-grade-mypy-configuration/
  module = [
      # Add external modules w/o type hints here
      "rasterio",
      "rasterio.crs",
  ]
  ignore_missing_imports = true
  
  [tool.flake8]
  max-line-length = 88
  # max-complexity = 10
  ignore = [
      "E203", # Allow whitespace before ':' (https://github.com/PyCQA/pycodestyle/issues/373)
      "F811", # Allow redefinition of unused name (necessary for typing.overload)
      "I002", # Don't check for isort configuration
      "W503", # Allow line break before binary operator (PEP 8-compatible)
      "E704", # Allow multiple statements on one line (def)
  ]
  per-file-ignores = [
      "__init__.py: F401", # Allow unused imports
  ]
  
  [tool.pylint]
  recursive = true
  ignore-imports = true
  max-line-length = 88
  # Tweak valid name formats
  # Defaults (http://pylint-messages.wikidot.com/messages:c0103):
  #  argument-rgx  = "^[a-z_][a-z0-9_]{2,30}$"
  #  attr-rgx      = "^[a-z_][a-z0-9_]{2,30}$"
  #  function-rgx  = "^[a-z_][a-z0-9_]{2,30}$"
  #  method-rgx    = "^[a-z_][a-z0-9_]{2,30}$"
  #  variable-rgx  = "^[a-z_][a-z0-9_]{2,30}$"
  #  class-rgx     = "^[A-Z_][a-zA-Z0-9]+$"
  #  const-rgx     = "^(([A-Z_][A-Z0-9_]*)|(__.*__))$"
  #  module-rgx    = "^(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$"
  argument-rgx = "^[a-z_][a-z0-9_]{,40}$"
  attr-rgx = "^[a-z_][a-z0-9_]{,40}$"
  function-rgx = "^[a-z_][a-z0-9_]{,40}$"
  method-rgx = "^[a-z_][a-z0-9_]{,40}$"
  variable-rgx = "^[a-z_][a-z0-9_]{,40}$"
  class-rgx = "^[A-Z_][a-zA-Z0-9]+$"
  const-rgx = "^(([a-z_][a-z0-9_]*)|([A-Z_][A-Z0-9_]*)|(__[a-zA-Z0-9]+__))$"
  module-rgx = "^(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$"
  inlinevar-rgx = "^[A-Za-z_][A-Za-z0-9_]*$"
  # Disable selected warnings, errors etc. that conflict with style guide etc.
  # Note: To locally ignore certain errors, use "pylint: disable=XXXX" comments instead!
  disable = [
      "C0115", # Missing class docstring
      "C0116", # Missing function or method docstring
      "R0903", # Too few public methods (*/2) (too-few-public-methods)
      # "R0801", # Similar lines in 2 files (duplicate-code)
      # -> see https://github.com/PyCQA/pylint/issues/214
      "R1705", # Unnecessary "elif" after "return" (no-else-return)
      "R1720", # Unnecessary "elif" after "raise" (no-else-raise)
      "R1724", # Unnecessary "elif" after "continue" (no-else-continue)
      "W1116", # Second argument of isinstance is not a type (isinstance-second-argument-not-valid-type)
  ]
  # Ignore (sub-)modules that trigger errors like E1101 (no-member) or E0611 (no-name-in-module)
  ignored-modules = []
  
  [tool.pydocstyle]
  # All codes: http://www.pydocstyle.org/en/stable/error_codes.html
  ignore = [
      # "D100", # Missing docstring in public module
      "D101", # Missing docstring in public class
      "D102", # Missing docstring in public method
      "D103", # Missing docstring in public function
      # "D104", # Missing docstring in public package
      "D105", # Missing docstring in magic method
      # "D105", # Missing docstring in public nested class
      "D107", # Missing docstring in __init__
      "D203", # Blank line required before class docstring
      "D213", # Multi-line docstring summary should start at the second line
      # "D405", # Section name should be properly capitalized
      "D406", # Section name should end with a newline
      "D407", # Missing dashed underline after section
  ]
  
  [tool.rstcheck]
  ignore_directives = ["automodule", "mdinclude", "autosummary"]
  
  [tool.codespell]
  ignore-words-list = "aare,inout,THIRDPARTY"
  skip = "poetry.lock"
  