sen-bridge / scripts /pyproject.toml
nikhilr01's picture
Upload folder using huggingface_hub
b0d8bdd verified
Raw History Blame Contribute Delete
3.56 kB
[project]
name = "sen-bridge"
version = "0.1.0"
description = "SEN-Bridge: FID, LPIPS, PSNR and SSIM for SAR-to-optical benchmarks (PyTorch and JAX), plus the dataset build code"
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE", "NOTICE", "licenses/*"]
authors = [{ name = "Nikhil Raghavendra", email = "nikhil612.r@gmail.com" }]
requires-python = ">=3.10"
dependencies = ["numpy", "scipy", "pillow"]
[project.optional-dependencies]
# Metrics backends: install the one you use.
torch = ["torch", "torchvision", "safetensors", "typing-extensions"]
jax = ["jax", "safetensors"]
# One-off conversion of the downloaded weights (python -m sen_bridge.weights). It
# unpickles the original .pth files, so it needs torch even for JAX users.
convert = ["torch", "safetensors"]
# scripts/evaluate.py and scripts/make_fid_stats.py (also install torch or jax).
eval = ["datasets"]
# The dataset build (sen_bridge_build and build/).
build = [
"pandas",
"pyarrow",
"requests",
"huggingface_hub",
"datasets",
"pyyaml",
"numcodecs",
"typing-extensions",
]
# Everything needed to run ./check.sh: tools, test references and type stubs.
dev = [
"sen-bridge[torch,jax,build]",
"pytest",
"ruff",
"ty",
"scikit-image",
"pytorch-fid",
"lpips",
"pandas-stubs",
"types-requests",
"types-pyyaml",
"scipy-stubs",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/sen_bridge", "src/sen_bridge_build"]
[tool.ruff]
line-length = 84
target-version = "py310"
src = ["src", "build", "scripts", "tests"]
extend-exclude = ["work"]
preview = true
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Both conflict with the formatter, which adds and removes these itself.
"missing-trailing-comma",
"single-line-implicit-string-concatenation",
]
[tool.ruff.lint.pycodestyle]
max-doc-length = 84 # docstrings and comments obey the same limit as code
[tool.ruff.lint.pydocstyle]
convention = "google" # the single docstring standard: Google style, checked by D and DOC rules
[tool.ruff.lint.flake8-copyright]
notice-rgx = "(?i)Copyright 20\\d{2} Nikhil Raghavendra"
[tool.ruff.lint.per-file-ignores]
"build/**" = [
# Scripts run as `python build/x.py`; they are not importable packages.
"implicit-namespace-package",
# Command-line tools report progress on stdout.
"print",
]
"scripts/**" = [
# Scripts run as `python scripts/x.py`; they are not importable packages.
"implicit-namespace-package",
# Command-line tools report results on stdout.
"print",
]
"tests/**" = [
# Tests are collected by pytest; they are not an importable package.
"implicit-namespace-package",
# pytest tests are written as assertions.
"assert",
# Tests compare against literal expected values.
"magic-value-comparison",
# The test name is the documentation of a test function.
"undocumented-public-function",
# Test functions return None.
"missing-return-type-undocumented-public-function",
# Tests reset module-level caches to exercise first-call behaviour.
"private-member-access",
]
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["build"] # the build scripts are imported by their file name
[tool.ty.src]
exclude = ["work", ".venv"]
[tool.ty.environment]
python-version = "3.10"
extra-paths = ["build", "tests"]
[tool.ty.rules]
all = "error"