-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpyproject.toml
247 lines (225 loc) · 7.39 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
[project]
name = "darts-nextgen"
version = "0.3.2"
description = "Panarctic Database of Active Layer Detachment Slides and Retrogressive Thaw Slumps from Deep Learning on High Resolution Satellite Imagery."
dependencies = [
# General
"numpy>=1.26.3, <2",
"xarray>=2024.9.0",
"ray[data]>=2.37.0",
"rich>=13.9.2",
"cyclopts>=3.1.0",
# Utils
"lovely-tensors>=0.1.17",
"lovely-numpy>=0.2.13",
"setuptools>=75.5.0",
# IO
"h5netcdf>=1.3.0",
"rasterio>=1.4.0",
"rioxarray>=0.17.0",
"geopandas>=1.0.1",
"shapely>=2.0.0",
"earthengine-api>=1.1.5",
"xee>=0.0.19",
"pystac>=1.11.0",
"xpystac>=0.1.3",
"odc-geo>=0.4.8",
"odc-stac[botocore]>=0.3.10",
"toml>=0.10.2",
"zarr[jupyter]>=2.18.3, <3",
# Training and Inference
"segmentation-models-pytorch>=0.4.0",
"lightning>=2.4.0",
"albumentations>=1.4.21",
"wandb>=0.18.7",
"optuna>=4.1.0",
"torchmetrics>=1.6.0",
"timm>=1.0.13",
# Processing
"scikit-image>=0.20",
"scipy>=1.14.1",
"xarray-spatial>=0.4.0",
"dask>=2024.11.0",
"distributed>=2024.12.0",
"geocube>=0.7.0",
# Visualization
"cartopy>=0.24.1",
"hvplot>=0.11.1",
"geoviews>=1.13.0",
"datashader>=0.16.3",
"folium>=0.18.0",
"bokeh>=3.5.2",
"jupyter-bokeh>=4.0.5",
"seaborn>=0.13.2",
"names-generator>=0.2.0",
"psycopg2>=2.9.10",
]
readme = "README.md"
requires-python = ">= 3.11"
authors = [
{ name = "Ingmar Nitze", email = "[email protected]" },
{ name = "Konrad Heidler", email = "[email protected]" },
{ name = "Jonas Küpper", email = "[email protected]" },
{ name = "Tobias Hölzer", email = "[email protected]" },
{ name = "Lucas von Chamier", email = "[email protected]" }
]
[project.optional-dependencies]
cpu = ["torch==2.2.0+cpu", "torchvision==0.17.0+cpu"]
cuda11 = [
"torch==2.2.0+cu118",
"torchvision==0.17.0+cu118",
"cucim-cu11>=24.8.0",
"cupy-cuda11x>=13.3.0",
"cupy-xarray @ git+https://github.com/xarray-contrib/cupy-xarray",
"cuda-python>=12.6.2.post1",
"pynvml==11.4.1",
]
cuda12 = [
"torch==2.2.0+cu121",
"torchvision==0.17.0+cu121",
"cucim-cu12==24.8.*",
"cupy-cuda12x>=13.3.0",
"cupy-xarray @ git+https://github.com/xarray-contrib/cupy-xarray",
"cuda-python>=12.6.2.post1",
"pynvml==11.4.1",
]
gdal393 = ["gdal==3.9.3"]
gdal39 = ["gdal==3.9.2"]
gdal38 = ["gdal==3.8.5"]
gdal384 = ["gdal==3.8.4"]
gdal37 = ["gdal==3.7.3"]
gdal36 = ["gdal==3.6.4"]
gdal384_win64 = ["gdal @ https://github.com/cgohlke/geospatial-wheels/releases/download/v2024.2.18/GDAL-3.8.4-cp311-cp311-win_amd64.whl"]
[project.scripts]
darts = "darts.cli:start_app"
# ==============================================================================
# Build System Configuration
# ==============================================================================
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["darts/src/darts"]
# ==============================================================================
# uv Configuration (Not used yet!)
# ==============================================================================
# Problems with uv:
# 1. gdal extra needs to be explicit deactivated. Otherwise, uv will try to build all gdal versions from source to get their requirements. This results in an error, because gdal expects the exact version of itself installed.
# 2. It is impossible to maintain both rye and uv, because rye needs the torch-endings "+cpu" or "+cu118" or "+cu121" to install the correct pytorch version. uv does handles these endings by itself.
# 3. UV toml syntax can't be read by Rye.
# [tool.uv]
# conflicts = [
# [
# { extra = "cpu" },
# { extra = "cuda11" },
# { extra = "cuda12" },
# ],
# [
# { extra = "gdal393" },
# { extra = "gdal39" },
# { extra = "gdal38" },
# { extra = "gdal384" },
# { extra = "gdal37" },
# { extra = "gdal36" },
# { extra = "gdal384_win64" },
# ]
# ]
# dependency-metadata = [
# { name = "gdal", requires-dist = ["setuptools"], requires-python = ">=3.9" },
# ]
# # TODO: Disable macos for now, fix later
# environments = [
# "platform_system != 'Darwin' or extra != 'cpu'"
# ]
# [tool.uv.sources]
# torch = [
# { index = "pytorch-cpu", extra = "cpu", marker = "platform_system != 'Darwin'" },
# { index = "pytorch-cu118", extra = "cuda11" },
# { index = "pytorch-cu121", extra = "cuda12" },
# ]
# torchvision = [
# { index = "pytorch-cpu", extra = "cpu", marker = "platform_system != 'Darwin'" },
# { index = "pytorch-cu118", extra = "cuda11" },
# { index = "pytorch-cu121", extra = "cuda12" },
# ]
#[[tool.uv.index]]
#name = "pytorch-cpu"
#url = "https://download.pytorch.org/whl/cpu"
#explicit = true
# [[tool.uv.index]]
# name = "pytorch-cu118"
# url = "https://download.pytorch.org/whl/cu118"
# explicit = true
# [[tool.uv.index]]
# name = "pytorch-cu121"
# url = "https://download.pytorch.org/whl/cu121"
# explicit = true
# ==============================================================================
# Rye Configuration
# ==============================================================================
[tool.rye]
managed = true
dev-dependencies = [
"ipykernel>=6.29.5",
"matplotlib>=3.9.2",
"ruff>=0.8.3",
"mkdocs>=1.6.1",
"mkdocs-material[imaging]>=9.5.38",
"mike>=2.1.3",
"mkdocstrings[python]>=0.26.1",
"mkdocs-git-revision-date-localized-plugin>=1.2.9",
"mkdocs-git-committers-plugin-2>=2.3.0",
"pyright>=1.1.384",
"pytest>=8",
"ipywidgets>=8.1.5",
"folium>=0.17.0",
"mapclassify>=2.8.1",
"mkdocs-glightbox>=0.4.0",
]
[tool.rye.workspace]
members = ["darts-*"]
[[tool.rye.sources]]
name = "nvidia"
url = "https://pypi.nvidia.com"
[[tool.rye.sources]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
[[tool.rye.sources]]
name = "pytorch-cu11"
url = "https://download.pytorch.org/whl/cu118"
[[tool.rye.sources]]
name = "pytorch-cu12"
url = "https://download.pytorch.org/whl/cu121"
# ==============================================================================
# Ruff Configuration
# ==============================================================================
[tool.ruff]
line-length = 120
indent-width = 4 # This is the default
[tool.ruff.lint]
# Default selected Rules are F, E4, E7 and E9 (all stable)
# We also enable preview Rules from E
# See https://docs.astral.sh/ruff/rules/ which rules do what
# F: Pyflakes
# E, W: Pycodestyle
# C: McCabe (code complexity)
# I: isort (import sorting)
# N: pip8-naming (naming conventions)
# D: pydocstyle (docstring formatting) <- this should help us to write documentation
# UP: pyupgrade <- this should help writing up-to-date code
# PD: pandas-vet <- this should help writing better pandas code
# FLY: flynt <- write f-strings
# NPY: numpy <- this should help writing better numpy code
# FURB: refurb <- this should help writing up-to-date code
# DOC: pydoclint <- this should help writing better docstrings
# RUF: ruff
preview = true
select = ["F", "E", "W", "C", "I", "N", "D", "UP", "PD", "FLY", "NPY", "FURB", "DOC", "RUF"]
# Ignore `E402` (import violations) in all `__init__.py` files, and in selected subdirectories.
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"**/{test,tests,docs,tools}/*" = ["E402", "D1"]
[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["test_*"]