[project]
name = "hyrax"
license = "MIT"
license-files = ["LICENSE"]
readme = "README.md"
authors = [
    { name = "LINCC Frameworks", email = "mtauraso@uw.edu" }
]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "Operating System :: OS Independent",
    "Programming Language :: Python",
]
dynamic = ["version"]
requires-python = ">=3.10"
dependencies = [
    "astropy", # Used to load fits files of sources to query HSC cutout server
    # Pin to the current version of pytorch ignite so workarounds to 
    # https://github.com/pytorch/ignite/issues/3372 function correctly
    # while allowing us to release packages that don't depend on dev versions
    # of pytorch-ignite.
    "pytorch-ignite <= 0.5.3", # Used for distributed training, logging, etc.
    "more-itertools", # Used to work around the issue in pytorch-ignite above
    "toml", # Used to load configuration files as dictionaries
    "tomlkit", # Used to load configuration files as dictionaries and retain comments
    "torch", # Used for CNN model and in train.py
    "torchvision", # Used in hsc data loader, example autoencoder, and CNN model data set
    "tensorboardX", # Used to log training metrics
    "tensorboard", # Used to log training metrics
    "schwimmbad", # Used to speedup hsc data loader file scans
    "chromadb > 1.0", # Used for similarity search
    "holoviews", # Used in Holoviews visualization prototype
    "bokeh", # Used in Holoviews visualization prototype
    "jupyter_bokeh", # Used in Holoviews visualization prototype
    "datashader", # Used in Holoviews visualization prototype
    "pandas", # Used in Holoviews visualization prototype
    "numpy", # Used in Holoviews visualization prototype
    "scipy", # Used in Holoviews visualization prototype
    "cython", # Used in Holoviews visualization prototype
    "mlflow", # Used to log training metrics and compare models
    "pynvml", # Used to gather GPU usage information
    "umap-learn", # Used to map latent spaces down to 2d
    "pooch", # Used to download data files
    "onnx", # Used to export models to ONNX format
    "onnxruntime", # Used to run ONNX models
    "onnxscript", # Used to convert PyTorch models to ONNX format
    "plotly", # Used in 3d visualization
    "psutil", # Used for memory monitoring
    "tqdm", # Used to show progress bars
    "qdrant-client", # Vector database for similarity search
    "colorama", # Used to color terminal output
]

[project.scripts]
hyrax = "hyrax_cli.main:main"

[project.urls]
"Source Code" = "https://github.com/lincc-frameworks/hyrax"

# On a mac, install optional dependencies with `pip install '.[dev]'` (include the single quotes)
[project.optional-dependencies]
examples = [
]

dev = [
    "asv[virtualenv]==0.6.5", # Used to compute performance benchmarks
    "jupyter", # Clears output from Jupyter notebooks
    "matplotlib", # For example notebooks
    "pre-commit", # Used to run checks before finalizing a git commit
    "pytest",
    "pytest-cov", # Used to report total code coverage
    "pytest-env", # Used to set environment variables in testing
    "pytest-xdist", # Used to parallelize unit tests
    "ruff", # Used for static linting of files
    "sphinx",
    "sphinx-autoapi",
    "nbsphinx",
    "sphinx-tabs",
    "sphinx-copybutton",
    "sphinx-togglebutton",
    "sphinx-rtd-theme",
]

[build-system]
requires = [
    "setuptools>=62", # Used to build and package the Python project
    "setuptools_scm>=6.2", # Gets release version from git. Makes it available programmatically
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/hyrax/_version.py"

[tool.pytest.ini_options]
testpaths = [
    "tests",
    "src",
    "docs",
]
addopts = "--doctest-modules --doctest-glob=*.rst"
env = [
    "TQDM_DISABLE=1",
]
markers = [
    "slow: marks tests as slow (deselect with '-m \"not slow\"')",
]

[tool.ruff]
line-length = 110
target-version = "py310"
[tool.ruff.lint]
select = [
    # pycodestyle
    "E",
    "W",
    # Pyflakes
    "F",
    # pep8-naming
    "N",
    # pyupgrade
    "UP",
    # flake8-bugbear
    "B",
    # flake8-simplify
    "SIM",
    # isort
    "I",
    # docstrings
    "D101",
    "D102",
    "D103",
    "D106",
    "D206",
    "D207",
    "D208",
    "D300",
    "D417",
    "D419",
    # Numpy v2.0 compatibility
    "NPY201",
]
ignore = [
    "UP006", # Allow non standard library generics in type hints
    "UP007", # Allow Union in type hints
    "SIM114", # Allow if with same arms
    "B028", # Allow default warning level
    "SIM117", # Allow nested with
    "UP015", # Allow redundant open parameters
    "UP028", # Allow yield in for loop
    "B905", # Allow zip without `strict`
]


[tool.coverage.run]
omit=["src/hyrax/_version.py"]
