2021-05-21 06:22:30 +03:00
[ build-system ]
requires = [
2023-07-01 00:37:33 +03:00
# setuptools 61+ required for pyproject.toml support
2023-07-20 23:01:47 +03:00
"setuptools>=61" ,
2021-05-21 06:22:30 +03:00
]
build-backend = "setuptools.build_meta"
2021-07-04 23:52:12 +03:00
2023-07-01 00:37:33 +03:00
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
[ project ]
name = "torchgeo"
description = "TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data"
readme = "README.md"
2024-04-04 10:15:56 +03:00
requires-python = ">=3.10"
2023-07-01 00:37:33 +03:00
license = { file = "LICENSE" }
authors = [
{ name = "Adam J. Stewart" , email = "ajstewart426@gmail.com" } ,
]
maintainers = [
{ name = "Adam J. Stewart" , email = "ajstewart426@gmail.com" } ,
{ name = "Caleb Robinson" , email = "Caleb.Robinson@microsoft.com" } ,
{ name = "Isaac Corley" , email = "isaac.corley@my.utsa.edu" } ,
{ name = "Nils Lehmann" , email = "n.lehmann@tum.de" } ,
{ name = "Ashwin Nair" , email = "ashnair0007@gmail.com" } ,
]
keywords = [ "pytorch" , "deep learning" , "machine learning" , "remote sensing" , "satellite imagery" , "earth observation" , "geospatial" ]
classifiers = [
"Development Status :: 3 - Alpha" ,
"Intended Audience :: Science/Research" ,
"License :: OSI Approved :: MIT License" ,
"Operating System :: OS Independent" ,
"Programming Language :: Python :: 3" ,
"Programming Language :: Python :: 3.10" ,
"Programming Language :: Python :: 3.11" ,
2024-02-06 18:04:40 +03:00
"Programming Language :: Python :: 3.12" ,
2023-07-01 00:37:33 +03:00
"Topic :: Scientific/Engineering :: Artificial Intelligence" ,
"Topic :: Scientific/Engineering :: GIS" ,
]
dependencies = [
# einops 0.3+ required for einops.repeat
2023-07-20 23:01:47 +03:00
"einops>=0.3" ,
2024-04-04 10:15:56 +03:00
# fiona 1.8.21+ required for Python 3.10 wheels
"fiona>=1.8.21" ,
2024-06-30 00:22:26 +03:00
# kornia 0.7.3+ required for instance segmentation support in AugmentationSequential
"kornia>=0.7.3" ,
2024-08-01 13:49:43 +03:00
# lightly 1.4.5+ required for LARS optimizer
2024-02-01 17:57:50 +03:00
# lightly 1.4.26 is incompatible with the version of timm required by smp
# https://github.com/microsoft/torchgeo/issues/1824
2024-08-01 13:49:43 +03:00
"lightly>=1.4.5,!=1.4.26" ,
2023-09-27 20:11:52 +03:00
# lightning 2+ required for LightningCLI args + sys.argv support
2024-08-07 15:26:39 +03:00
# lightning 2.3 contains known bugs related to YAML parsing
2024-07-08 17:22:51 +03:00
# https://github.com/Lightning-AI/pytorch-lightning/issues/19977
2024-08-07 15:26:39 +03:00
"lightning[pytorch-extra]>=2,!=2.3.*" ,
2024-04-04 10:15:56 +03:00
# matplotlib 3.5+ required for Python 3.10 wheels
"matplotlib>=3.5" ,
# numpy 1.21.2+ required by Python 3.10 wheels
"numpy>=1.21.2" ,
# pandas 1.3.3+ required for Python 3.10 wheels
"pandas>=1.3.3" ,
# pillow 8.4+ required for Python 3.10 wheels
"pillow>=8.4" ,
# pyproj 3.3+ required for Python 3.10 wheels
"pyproj>=3.3" ,
# rasterio 1.3+ required for Python 3.10 wheels
"rasterio>=1.3" ,
# rtree 1+ required for Python 3.10 wheels
2023-07-20 23:01:47 +03:00
"rtree>=1" ,
2023-07-01 00:37:33 +03:00
# segmentation-models-pytorch 0.2+ required for smp.losses module
2023-07-20 23:01:47 +03:00
"segmentation-models-pytorch>=0.2" ,
2024-04-04 10:15:56 +03:00
# shapely 1.8+ required for Python 3.10 wheels
"shapely>=1.8" ,
2023-07-01 00:37:33 +03:00
# timm 0.4.12 required by segmentation-models-pytorch
2023-07-20 23:01:47 +03:00
"timm>=0.4.12" ,
2023-11-25 23:39:43 +03:00
# torch 1.13+ required by torchvision
"torch>=1.13" ,
2023-07-01 00:37:33 +03:00
# torchmetrics 0.10+ required for binary/multiclass/multilabel classification metrics
2023-07-20 23:01:47 +03:00
"torchmetrics>=0.10" ,
2023-11-25 23:39:43 +03:00
# torchvision 0.14+ required for torchvision.models.swin_v2_b
"torchvision>=0.14" ,
2023-07-01 00:37:33 +03:00
]
dynamic = [ "version" ]
[ project . optional-dependencies ]
datasets = [
2024-04-04 10:15:56 +03:00
# h5py 3.6+ required for Python 3.10 wheels
"h5py>=3.6" ,
2023-07-01 00:37:33 +03:00
# laspy 2+ required for laspy.read
2023-07-20 23:01:47 +03:00
"laspy>=2" ,
2024-04-04 10:15:56 +03:00
# opencv-python 4.5.4+ required for Python 3.10 wheels
"opencv-python>=4.5.4" ,
# pycocotools 2.0.7+ required for wheels
"pycocotools>=2.0.7" ,
2023-09-25 18:51:36 +03:00
# pyvista 0.34.2+ required to avoid ImportError in CI
"pyvista>=0.34.2" ,
2024-04-04 10:15:56 +03:00
# scikit-image 0.19+ required for Python 3.10 wheels
"scikit-image>=0.19" ,
# scipy 1.7.2+ required for Python 3.10 wheels
"scipy>=1.7.2" ,
2023-07-01 00:37:33 +03:00
]
docs = [
# ipywidgets 7+ required by nbsphinx
2023-07-20 23:01:47 +03:00
"ipywidgets>=7" ,
2023-07-01 00:37:33 +03:00
# nbsphinx 0.8.5 fixes bug with nbformat attributes
2023-07-20 23:01:47 +03:00
"nbsphinx>=0.8.5" ,
2023-07-01 00:37:33 +03:00
# release versions missing files, must install from master
"pytorch-sphinx-theme" ,
2024-09-01 13:06:26 +03:00
# sphinx 4+ required for autodoc_typehints_description_target
2023-07-01 00:37:33 +03:00
# sphinx 6+ is incompatible with pytorch-sphinx-theme
# https://github.com/pytorch/pytorch_sphinx_theme/issues/175
"sphinx>=4,<6" ,
]
style = [
# mypy 0.900+ required for pyproject.toml support
2023-07-20 23:01:47 +03:00
"mypy>=0.900" ,
2023-07-01 00:37:33 +03:00
# ruff 0.2+ required for [ruff.lint]
2024-04-16 00:46:00 +03:00
"ruff>=0.2" ,
]
2023-07-01 00:37:33 +03:00
tests = [
# nbmake 1.3.3+ required for variable mocking
2023-07-20 23:01:47 +03:00
"nbmake>=1.3.3" ,
2023-10-13 20:43:41 +03:00
# pytest 7.3+ required for tmp_path_retention_policy
"pytest>=7.3" ,
# pytest-cov 4+ required for pytest 7.2+ compatibility
"pytest-cov>=4" ,
2023-07-01 00:37:33 +03:00
]
all = [
"torchgeo[datasets,docs,style,tests]" ,
]
2023-09-27 20:11:52 +03:00
[ project . scripts ]
torchgeo = "torchgeo.main:main"
2023-07-01 00:37:33 +03:00
[ project . urls ]
Homepage = "https://github.com/microsoft/torchgeo"
Documentation = "https://torchgeo.readthedocs.io"
2024-08-28 21:09:14 +03:00
# https://coverage.readthedocs.io/en/latest/config.html
2021-12-04 01:40:50 +03:00
[ tool . coverage . report ]
# Ignore warnings for overloads
# https://github.com/nedbat/coveragepy/issues/970#issuecomment-612602180
2024-08-28 21:09:14 +03:00
exclude_also = [
2021-12-04 01:40:50 +03:00
"@overload" ,
]
2024-08-23 18:13:08 +03:00
# https://mypy.readthedocs.io/en/stable/config_file.html
2021-07-04 23:52:12 +03:00
[ tool . mypy ]
2024-08-23 18:13:08 +03:00
# Import discovery
2021-07-04 23:52:12 +03:00
ignore_missing_imports = true
2024-08-23 18:13:08 +03:00
exclude = "(build|data|dist|docs/.*|images|logo|.*logs|output|requirements)/"
2021-07-04 23:52:12 +03:00
2024-08-23 18:13:08 +03:00
# Disallow dynamic typing (TODO: work in progress)
disallow_any_unimported = false
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_explicit = false
2021-07-04 23:52:12 +03:00
disallow_any_generics = true
disallow_subclassing_any = true
2024-08-23 18:13:08 +03:00
# Untyped definitions and calls
2021-07-04 23:52:12 +03:00
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
2024-08-23 18:13:08 +03:00
# Configuring warnings
2021-07-04 23:52:12 +03:00
warn_redundant_casts = true
warn_unused_ignores = true
2024-08-23 18:13:08 +03:00
warn_no_return = true
2021-07-04 23:52:12 +03:00
warn_return_any = true
2024-08-23 18:13:08 +03:00
warn_unreachable = true
# Miscellaneous strictness flags
2021-07-04 23:52:12 +03:00
strict_equality = true
2024-08-23 18:13:08 +03:00
strict = true
# Configuring error messages
pretty = true
# Miscellaneous
warn_unused_configs = true
2021-07-04 23:52:12 +03:00
2021-06-24 19:02:23 +03:00
[ tool . pytest . ini_options ]
2021-08-21 01:07:14 +03:00
# Skip slow tests by default
addopts = "-m 'not slow'"
2021-12-30 23:46:27 +03:00
# https://docs.pytest.org/en/latest/how-to/capture-warnings.html
2021-07-27 20:06:12 +03:00
filterwarnings = [
2021-12-30 23:46:27 +03:00
# Warnings raised by dependencies of dependencies, out of our control
2022-06-18 18:00:45 +03:00
# https://github.com/Cadene/pretrained-models.pytorch/issues/221
"ignore:.* is deprecated and will be removed in Pillow 10:DeprecationWarning:pretrainedmodels.datasets.utils" ,
2022-06-13 20:38:17 +03:00
# https://github.com/pytorch/vision/pull/5898
2022-06-18 18:00:45 +03:00
"ignore:.* is deprecated and will be removed in Pillow 10:DeprecationWarning:torchvision.transforms.functional_pil" ,
2023-03-22 15:26:45 +03:00
"ignore:.* is deprecated and will be removed in Pillow 10:DeprecationWarning:torchvision.transforms._functional_pil" ,
2024-08-31 15:38:28 +03:00
# https://github.com/huggingface/pytorch-image-models/pull/1256
2022-06-18 18:00:45 +03:00
"ignore:.* is deprecated and will be removed in Pillow 10:DeprecationWarning:timm.data" ,
2022-06-13 20:38:17 +03:00
# https://github.com/pytorch/pytorch/issues/72906
# https://github.com/pytorch/pytorch/pull/69823
2023-07-01 00:37:33 +03:00
"ignore:distutils Version classes are deprecated. Use packaging.version instead:DeprecationWarning" ,
2022-07-11 08:30:48 +03:00
"ignore:The distutils package is deprecated and slated for removal in Python 3.12:DeprecationWarning:torch.utils.tensorboard" ,
2023-10-28 16:32:59 +03:00
# https://github.com/Lightning-AI/torchmetrics/issues/2121
# https://github.com/Lightning-AI/torchmetrics/pull/2137
"ignore:The distutils package is deprecated and slated for removal in Python 3.12:DeprecationWarning:torchmetrics.utilities.imports" ,
2022-09-08 07:29:12 +03:00
# https://github.com/Lightning-AI/lightning/issues/13256
# https://github.com/Lightning-AI/lightning/pull/13261
2022-06-18 18:00:45 +03:00
"ignore:torch.distributed._sharded_tensor will be deprecated:DeprecationWarning:torch.distributed._sharded_tensor" ,
2022-08-03 02:39:10 +03:00
# https://github.com/Lightning-AI/lightning/issues/13989
2023-03-16 19:14:48 +03:00
"ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:lightning.pytorch.trainer.connectors.callback_connector" ,
2022-09-08 07:29:12 +03:00
# https://github.com/Lightning-AI/lightning/issues/14594
2023-03-16 19:14:48 +03:00
"ignore:To copy construct from a tensor, it is recommended to use:UserWarning:lightning.pytorch.core.module" ,
2022-06-18 18:00:45 +03:00
# https://github.com/rasterio/rasterio/issues/1742
# https://github.com/rasterio/rasterio/pull/1753
"ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated:DeprecationWarning:rasterio.crs" ,
# https://github.com/pytorch/pytorch/issues/60053
# https://github.com/pytorch/pytorch/pull/60059
"ignore:Named tensors and all their associated APIs are an experimental feature and subject to change:UserWarning:torch.nn.functional" ,
2022-07-09 19:32:38 +03:00
# https://github.com/tensorflow/tensorboard/issues/5798
"ignore:Call to deprecated create function:DeprecationWarning:tensorboard.compat.proto" ,
2022-07-11 08:30:48 +03:00
# https://github.com/treebeardtech/nbmake/issues/68
'ignore:The \(fspath. py.path.local\) argument to NotebookFile is deprecated:pytest.PytestDeprecationWarning:nbmake.pytest_plugin' ,
2023-08-03 02:04:47 +03:00
# https://github.com/pytorch/pytorch/pull/24929
"ignore:Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0:UserWarning:torch.nn.functional" ,
2023-01-23 08:37:24 +03:00
# https://github.com/scikit-image/scikit-image/issues/6663
# https://github.com/scikit-image/scikit-image/pull/6637
"ignore:`np.bool8` is a deprecated alias for `np.bool_`.:DeprecationWarning:skimage.util.dtype" ,
2023-01-25 02:23:14 +03:00
# https://github.com/lanpa/tensorboardX/pull/677
"ignore:ANTIALIAS is deprecated and will be removed in Pillow 10:DeprecationWarning:tensorboardX.summary" ,
2023-02-15 01:21:46 +03:00
# https://github.com/Lightning-AI/lightning/issues/16756
2023-03-16 19:14:48 +03:00
"ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning" ,
2023-10-04 15:41:25 +03:00
"ignore:pkg_resources is deprecated as an API.:DeprecationWarning:lightning_utilities.core.imports" ,
2023-09-27 20:11:52 +03:00
"ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated:DeprecationWarning:jsonargparse" ,
2024-09-01 13:06:26 +03:00
"ignore:`ModuleAvailableCache` is a special case of `RequirementCache`.:DeprecationWarning:lightning.fabric.plugins.environments.xla" ,
2023-10-13 23:04:05 +03:00
# https://github.com/pytorch/pytorch/issues/110549
"ignore:allow_ops_in_compiled_graph failed to import torch:ImportWarning:einops" ,
2024-03-03 21:45:40 +03:00
# https://github.com/rr-/docstring_parser/pull/82
"ignore:ast.* is deprecated and will be removed in Python 3.14:DeprecationWarning:docstring_parser.attrdoc" ,
# https://github.com/python/cpython/pull/102953
2024-08-13 20:30:00 +03:00
"ignore:Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata:DeprecationWarning:torchgeo.datasets.utils" ,
2024-09-01 13:06:26 +03:00
"ignore:Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata:DeprecationWarning:torchgeo.datasets.digital_typhoon" ,
"ignore:Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata:DeprecationWarning:torchvision.datasets.utils" ,
2024-08-13 20:30:00 +03:00
# https://github.com/kornia/kornia/pull/2967
"ignore:`torch.cuda.amp.custom_fwd\\(args...\\)` is deprecated.:FutureWarning:kornia.feature.lightglue" ,
# https://github.com/kornia/kornia/pull/2981
"ignore:torch.is_autocast_cpu_enabled\\(\\) is deprecated.:DeprecationWarning:kornia.utils.helpers" ,
# https://github.com/pytorch/pytorch/pull/129239
"ignore:You are using `torch.load` with `weights_only=False`:FutureWarning" ,
2021-12-30 23:46:27 +03:00
# Expected warnings
2023-03-16 19:14:48 +03:00
# Lightning warns us about using num_workers=0, but it's faster on macOS
2023-10-14 00:33:37 +03:00
"ignore:The .*dataloader.* does not have many workers which may be a bottleneck:UserWarning:lightning" ,
"ignore:The .*dataloader.* does not have many workers which may be a bottleneck:lightning.fabric.utilities.warnings.PossibleUserWarning:lightning" ,
2023-03-22 15:26:45 +03:00
# Lightning warns us about using the CPU when GPU/MPS is available
2022-06-18 18:00:45 +03:00
"ignore:GPU available but not used.:UserWarning" ,
2023-03-22 15:26:45 +03:00
"ignore:MPS available but not used.:UserWarning" ,
# Lightning warns us if TensorBoard is not installed
"ignore:Starting from v1.9.0, `tensorboardX` has been removed as a dependency of the `lightning.pytorch` package:UserWarning" ,
2023-09-27 20:11:52 +03:00
# https://github.com/Lightning-AI/lightning/issues/18545
"ignore:LightningCLI's args parameter is intended to run from within Python like if it were from the command line.:UserWarning" ,
2023-02-18 20:03:47 +03:00
# https://github.com/kornia/kornia/pull/1663
2024-03-03 20:26:01 +03:00
"ignore:`RandomGaussianBlur` has changed its behavior and now randomly sample sigma for both axes.:DeprecationWarning" ,
2023-11-16 14:34:47 +03:00
# https://github.com/pytorch/pytorch/pull/111576
"ignore:Skipping device Apple Paravirtual device that does not support Metal 2.0:UserWarning" ,
2021-12-30 23:46:27 +03:00
# Unexpected warnings, worth investigating
2023-09-27 20:11:52 +03:00
# https://github.com/pytest-dev/pytest/issues/11461
"ignore::pytest.PytestUnraisableExceptionWarning" ,
2021-07-27 20:06:12 +03:00
]
2021-08-21 00:38:37 +03:00
markers = [
"slow: marks tests as slow" ,
]
2021-08-21 01:07:14 +03:00
norecursedirs = [
2021-08-25 03:47:55 +03:00
".ipynb_checkpoints" ,
2021-08-21 01:07:14 +03:00
"data" ,
"__pycache__" ,
]
testpaths = [
"tests" ,
"docs/tutorials" ,
]
2023-10-13 20:43:41 +03:00
tmp_path_retention_policy = "failed"
2023-07-01 00:37:33 +03:00
2024-03-03 21:45:40 +03:00
# https://docs.astral.sh/ruff/settings/
2024-04-16 00:46:00 +03:00
[ tool . ruff ]
2023-07-01 00:37:33 +03:00
extend-include = [ "*.ipynb" ]
2024-04-16 00:46:00 +03:00
fix = true
2021-12-04 01:40:50 +03:00
[ tool . ruff . format ]
2023-07-01 00:37:33 +03:00
quote-style = "single"
2021-11-13 22:56:29 +03:00
skip-magic-trailing-comma = true
2024-04-16 00:46:00 +03:00
[ tool . ruff . lint ]
2024-09-06 18:29:15 +03:00
extend-select = [ "ANN" , "D" , "I" , "RUF" , "UP" ]
2024-08-12 15:32:31 +03:00
ignore = [ "ANN101" , "ANN102" , "ANN401" ]
2024-04-16 00:46:00 +03:00
2022-07-11 08:30:48 +03:00
[ tool . ruff . lint . per-file-ignores ]
2024-08-12 15:32:31 +03:00
"docs/**" = [ "ANN" , "D" ]
2023-07-01 00:37:33 +03:00
"experiments/**" = [ "D" ]
2021-12-24 23:47:54 +03:00
"tests/**" = [ "D" ]
2024-04-16 00:46:00 +03:00
2021-07-05 01:03:27 +03:00
[ tool . ruff . lint . isort ]
2021-11-13 22:56:29 +03:00
split-on-trailing-comma = false
2024-04-16 00:46:00 +03:00
2021-07-16 20:20:08 +03:00
[ tool . ruff . lint . pydocstyle ]
convention = "google"
2024-04-16 00:46:00 +03:00
2023-07-01 00:37:33 +03:00
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[ tool . setuptools . dynamic ]
version = { attr = "torchgeo.__version__" }
[ tool . setuptools . package-data ]
torchgeo = [ "py.typed" ]
[ tool . setuptools . packages . find ]
include = [ "torchgeo*" ]