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

[project]
name = "gsMap3D"
authors = [{ name = "liyang", email = "songliyang@westlake.edu.cn" },
    { name = "wenhao", email = "chenwenhao@westlake.edu.cn" }]
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.12"
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Operating System :: POSIX :: Linux",
]
version = "0.1.0.a2"
description = "Genetically informed spatial mapping of cells for complex traits"
dependencies = [
    "numpy ~= 2.2",
    "pandas",
    "scipy",
    "scikit-learn",
    "matplotlib",
    "tqdm",
    "pyyaml",
    "torch ~= 2.5",
    "torch-geometric ~= 2.7",
    "pyranges",
    "pyfiglet",
    "plotly",
    "kaleido",
    "jinja2",
    "scanpy >=1.11.0",
    "zarr >=2.18.0",
    "bitarray >=2.9.2, <3.0.0",
    "pyarrow",
    "numba",
    "jax >=0.7.2, <1.0.0",
    "pandas_plink",
    "rich >= 14.1.0",
    "anndata >= 0.8.0",
    "h5py >= 3.0.0",
    "statsmodels >= 0.13.0",
    "psutil >= 5.8.0",
    "pyvista >= 0.35.0",
    "typer ~= 0.20.0",
    "einops",
    "distinctipy>=1.3.4",
]

[project.optional-dependencies]
doc = [
    "sphinx",
    'sphinx-argparse',
    'sphinx-autobuild',
    'sphinx-autodoc-typehints',
    'sphinx-basic-ng',
    'sphinx-charts',
    'sphinx-copybutton',
    'sphinx_inline_tabs',
    'sphinx-markdown-tables',
    'sphinx-rtd-theme',
    'sphinxcontrib-applehelp',
    'sphinxcontrib-devhelp',
    'sphinxcontrib-htmlhelp',
    'sphinxcontrib-jquery',
    'sphinxcontrib-jsmath',
    'sphinxcontrib-qthelp',
    'sphinxcontrib-serializinghtml',
    'furo',
    'myst-parser',
    'nbsphinx',
    'sphinxcontrib-mermaid',
]

tests = [
    "pytest>=7.0.0",
    "pytest-cov>=4.0.0",
    "coverage",
]

cuda = [
    "jax[cuda13] >=0.7.2, <1.0.0",
]

tpu = [
    "jax[tpu] >=0.7.2, <1.0.0",
]

[project.urls]
Home = "https://github.com/Ganten-Hornby/gsMap3D"
Documentation = "https://yanglab.westlake.edu.cn/gsmap3d/docs"
Website = "https://yanglab.westlake.edu.cn/gsmap3d"

[project.scripts]
gsmap = "gsMap.cli:app"

[tool.hatch.build.targets.wheel]
packages = ["src/gsMap"]

[tool.hatch.build.targets.sdist]
include = [
    "src/gsMap/**",
]


[tool.ruff]
src = ["src"]
line-length = 99
indent-width = 4
target-version = "py312"

# Exclude a variety of commonly ignored directories.
exclude = [
    ".bzr",
    ".direnv",
    ".eggs",
    ".git",
    ".git-rewrite",
    ".hg",
    ".mypy_cache",
    ".nox",
    ".pants.d",
    ".pytype",
    ".ruff_cache",
    ".svn",
    ".tox",
    ".venv",
    "__pypackages__",
    "_build",
    "buck-out",
    "build",
    "dist",
    "node_modules",
    "venv",
]

[tool.ruff.lint]
select = [
    "F",  # Errors detected by Pyflakes
    "E",  # Error detected by Pycodestyle
    "W",  # Warning detected by Pycodestyle
    "I",  # isort
    "B",  # flake8-bugbear
    "TID",  # flake8-tidy-imports
    "C4",  # flake8-comprehensions
    "BLE",  # flake8-blind-except
    "UP",  # pyupgrade
    "RUF100",  # Report unused noqa directives
    "PT", # pytest style
    "NPY", # numpy formatting
    "TCH", # flake8-type-checking
    "FA", # flake8-future-annotations
]
ignore = [
    # allow I, O, l as variable names -> I is the identity matrix
    "E741",
    # Errors from function calls in argument defaults. These are fine when the result is immutable.
    "B008",
    # Raising ValueError is sufficient in tests.
    "PT011",
    # We support np.random functions.
    "NPY002",
    # Line too long
    "E501",
    # Loop variable is not used
    "B007",
    # Allow string in percent format
    "UP031",
    # Allow dict call within literal
    "C408"
]

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

[tool.ruff.lint.per-file-ignores]
"docs/*" = ["I", "BLE001"]
"tests/*" = ["D"]
"*/__init__.py" = ["F401"]

[tool.ruff.format]
docstring-code-format = true
# 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"

[tool.jupytext]
formats = "ipynb,md"

[dependency-groups]
dev = [
    "ty>=0.0.14",
]

[tool.ruff.lint.flake8-type-checking]
exempt-modules = []
strict = true

[tool.ty]
# Configuration for ty type checker
