content: [tool.poetry]
  name = "cellseg_models_pytorch"
  version = "0.1.28"
  description = "Python library for 2D cell/nuclei instance segmentation models written with PyTorch."
  authors = ["Okunator <oskari.lehtonen@helsinki.fi>"]
  license = "MIT"
  readme = "README.md"
  homepage = "https://github.com/okunator/cellseg_models.pytorch"
  repository = "https://github.com/okunator/cellseg_models.pytorch"
  keywords = [
      "cell segmentation",
      "nuclei segmentation",
      "pytorch",
      "pytorch-lightning",
  ]
  
  [tool.poetry.dependencies]
  python = "^3.10"
  numpy = "^1.24"
  timm = "^1.0.7"
  numba = "^0.60.0"
  torch = ">=2.0.0,<3.0.0"
  scipy = "^1.14"
  scikit-image = "^0.25"
  opencv-python = "^4.8"
  tqdm = "^4.64.0"
  scikit-learn = "^1.3.0"
  requests = "^2.28.0"
  geopandas = "^1.0.1"
  pyarrow = "^16.1.0"
  rasterio = "^1.4.3"
  libpysal = "^4.12.1"
  mpire = {extras = ["dill"], version = "^2.10.2"}
  
  [tool.poetry.group.dev.dependencies]
  pytest = "^7.2.0"
  pytest-cov = "^3.0.0"
  pytest-xdist = "^2.5.0"
  flake8 = "^4.0.1"
  flake8-docstrings = "^1.6.0"
  flake8-bugbear = "^22.1.11"
  pyproject-flake8 = "^4.0.1"
  pre-commit = "^2.17.0"
  matplotlib = "^3.5.1"
  mypy = "^0.931"
  isort = "^5.10.1"
  black = "^22.3.0"
  scriv = { extras = ["toml"], version = "^0.16.0" }
  
  [tool.scriv]
  format = "md"
  version = "literal: cellseg_models_pytorch/__init__.py: __version__"
  
  [tool.pytest.ini_options]
  minversion = "6.0"
  addopts = "-ra -v"
  markers = ["cuda (deselect with '-m \"nocuda\"')"]
  
  [tool.coverage.run]
  source = ["cellseg_models_pytorch"]
  
  [tool.coverage.report]
  omit = ["*/tests/*", "*/__init__.py", "*/albu_transforms/*", "*/legacy/*", "*/file_manager.py"]
  exclude_lines = [
      "raise TypeError",
      "raise ImportError",
      "raise NotImplementedError",
      "raise ZeroDivisionError",
      "raise ValueError",
      "raise IOError",
      "except ImportError",
      "except TypeError",
      "except Exception",
      "def extra_repr",
  ]
  
  [tool.ruff]
  select = [
      "A",     # flake8-builtins
      "B",     # flake8-bugbear
      "D",     # pydocstyle, need to enable for docstrings check.
      "E",     # pycodestyle - Error
      "F",     # pyflakes
      "G",     # flake8-logging-format
      "I",     # Isort
      "N",     # pep8-naming
      "S",     # flake8-bandit
      "W",     # pycodestyle - Warning
      "Q",     # flake8-quotes
      "C4",    # flake8-comprehensions
      "FA",    # flake8-future-annotations
      "EM",    # flake8-errmsg
      "PD",    # pandas-vet
      "PL",    # Pylint
      "PT",    # flake8-pytest-style
      "TD",    # flake8-todos
      "UP",    # pyupgrade
      "C90",   # mccabe
      "T10",   # flake8-debugger
      "T20",   # flake8-print
      "ANN",   # flake8-annotations
      "ARG",   # flake8-unused-arguments
      "BLE",   # flake8-blind-except
      "COM",   # flake8-commas
      "DTZ",   # flake8-datetimez
      "ERA",   # eradicate
      "FBT",   # flake8-boolean-trap
      "FIX",   # flake8-fixme
      "FLY",   # flynt
      "ICN",   # flake8-import-conventions
      "INP",   # flake8-no-pep420
      "INT",   # flake8-gettext
      "ISC",   # flake8-implicit-str-concat
      "NPY",   # NumPy-specific rules
      "PGH",   # pygrep-hooks
      "PIE",   # flake8-pie
      "PTH",   # flake8-use-pathlib
      "PYI",   # flake8-pyi
      "RET",   # flake8-return
      "RSE",   # flake8-raise
      "RUF",   # Ruff-specific rules
      "SLF",   # flake8-self
      "SIM",   # flake8-simplify
      "TID",   # flake8-tidy-imports
      # "TCH",   # flake8-type-checking
      "TRY",   # tryceratops
      "YTT",   # flake8-2020
      "PERF",  # Perflint
      "SLOT",  # flake8-slots
      "ASYNC", # flake8-async
  ]
  
  include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
  extend-include = ["*.ipynb"]
  # Exclude a variety of commonly ignored directories.
  exclude = [
      ".bzr",
      ".direnv",
      ".eggs",
      ".git",
      ".git-rewrite",
      ".hg",
      ".ipynb_checkpoints",
      ".mypy_cache",
      ".nox",
      ".pants.d",
      ".pyenv",
      ".pytest_cache",
      ".pytype",
      ".ruff_cache",
      ".svn",
      ".tox",
      ".venv",
      ".vscode",
      "conftest.py",
      "old",
      "test",
      "tests",
      "__pypackages__",
      "__pycache__",
      "_build",
      "docs",
      "source",
      "buck-out",
      "build",
      "dist",
      "node_modules",
      "site-packages",
      "venv",
  ]
  
  # Same as Black.
  line-length = 88
  indent-width = 4
  
  # Assume Python 3.10
  target-version = "py310"
  
  [tool.ruff.pydocstyle]
   # Use numpy-style docstrings.
  convention = "google"
  
  [tool.ruff.lint]
  # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`)  codes by default.
  select = ["E4", "E7", "E9", "F"]
  ignore = ["E203", "D103", "D104", "E501"]
  
  # Allow fix for all enabled rules (when `--fix`) is provided.
  fixable = ["ALL"]
  unfixable = ["B"]
  
  # Allow unused variables when underscore-prefixed.
  dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  
  [tool.ruff.format]
  # Like Black, use double quotes for strings.
  quote-style = "double"
  
  # Like Black, indent with spaces, rather than tabs.
  indent-style = "space"
  
  # Like Black, respect magic trailing commas.
  skip-magic-trailing-comma = false
  
  # Like Black, automatically detect the appropriate line ending.
  line-ending = "auto"
  
  # format docs
  docstring-code-format = true
  
  # docstr code line length
  # docstring-code-line-length = "dynamic"
  
  [tool.ruff.lint.per-file-ignores]
  "__init__.py" = ["E402"]
  "**/{tests,docs,tools}/*" = ["E402"]
  
  [build-system]
  requires = ["poetry-core>=1.0.0"]
  build-backend = "poetry.core.masonry.api"
  