forked from ecmwf/WeatherGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
183 lines (157 loc) · 4.73 KB
/
pyproject.toml
File metadata and controls
183 lines (157 loc) · 4.73 KB
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
[project]
name = "weathergen"
version = "0.1.0"
description = "The WeatherGenerator Machine Learning Earth System Model"
readme = "README.md"
authors = [
{ name = "WeatherGenerator collaboration" }
]
requires-python = ">=3.12,<3.13"
# TODO: split the plotting dependencies into their own dep groups, they are not required.
dependencies = [
'torch==2.6.0',
'numpy~=2.2',
'astropy_healpix~=1.1.2',
'zarr~=2.17',
'anemoi-datasets~=0.5.16',
'pandas~=2.2',
'pynvml',
'tqdm',
'matplotlib',
'packaging',
'wheel',
'psutil',
"flash-attn; sys_platform == 'linux'",
"polars~=1.25.2",
"omegaconf~=2.3.0",
"dask~=2025.5.1",
"hatchling",
"weathergen-common",
"weathergen-evaluate",
"numexpr>=2.11.0",
]
[project.urls]
Homepage = "https://www.weathergenerator.eu"
Documentation = "https://readthedocs.org"
Repository = "https://github.com/ecmwf/WeatherGenerator.git"
Issues = "https://github.com/ecmwf/WeatherGenerator/issues"
[project.scripts]
train = "weathergen.run_train:train"
train_continue = "weathergen.run_train:train_continue"
inference = "weathergen.run_train:inference"
evaluate = "weathergen.evaluate.run_evaluation:evaluate"
plot_train = "weathergen.utils.plot_training:plot_train"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/weathergen"]
[dependency-groups]
# The development dependencies
dev = [
"ipykernel>=6.30.0",
"jupytext>=1.17.2",
"pytest~=8.3.5",
"pytest-mock>=3.14.1",
"ruff==0.9.7",
"tensorboard>=2.20.0",
"pdbpp>=0.11.7",
]
[tool.black]
# Wide rows
line-length = 100
# The linting configuration
[tool.ruff]
# Wide rows
line-length = 100
[tool.ruff.lint]
# All disabled until the code is formatted.
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
# Banned imports
"TID",
# Naming conventions
"N",
# print
"T201"
]
# These rules are sensible and should be enabled at a later stage.
ignore = [
# "B006",
"B011",
"UP008",
"SIM117",
"SIM118",
"SIM102",
"SIM401",
# To ignore, not relevant for us
"SIM108", # in case additional norm layer supports are added in future
"N817", # we use heavy acronyms, e.g., allowing 'import LongModuleName as LMN' (LMN is accepted)
"E731", # overly restrictive and less readable code
"N812", # prevents us following the convention for importing torch.nn.functional as F
]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"numpy.ndarray".msg = "Do not use 'ndarray' to describe a numpy array type, it is a function. Use numpy.typing.NDArray or numpy.typing.NDArray[np.float32] for example"
[tool.ruff.format]
# Use Unix `\n` line endings for all files
line-ending = "lf"
[tool.uv]
# Most work is done a distributed filesystem, where hardlink is not always possible.
# Also, trying to resolve some permissions issue, see #344.
link-mode = "symlink"
# This guarantees that the build is deterministic and will not be impacted
# by future releases of dependencies or sub-dependencies.
# See https://docs.astral.sh/uv/reference/settings/#exclude-newer
# TODO: pytorch does not publish valid release timestamps, so sadly it does not work.
# exclude-newer = "2025-03-14T00:00:00Z"
# The minimum version of uv required.
# It is tightly controlled because the format of uv.lock has changed
# over revisions, causing reformats to happen without reason.
# Also, relatively recent versions are required to support workspaces.
required-version = ">=0.7.0"
# Following the recommendations from https://docs.astral.sh/uv/guides/integration/pytorch
# The current setup is:
# linux == GPU + flashattention
# windows == GPU
# macos == CPU
[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124"
explicit = true
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
weathergen-common = { workspace = true }
weathergen-evaluate = { workspace = true }
torch = [
{ index = "pytorch-cu124", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
{ index = "pytorch-cpu", marker = "sys_platform == 'macosx'"},
]
# This URL was evaluated this way:
# uv run ~/WeatherGenerator-private/hpc/hpc2020/ecmwf/get-flash-atten.sh
flash-attn = [
{ url = "https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp312-cp312-linux_x86_64.whl", marker = "sys_platform == 'linux'" },
]
[tool.pytest.ini_options]
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
[tool.uv.workspace]
members = [
"packages/evaluate",
"packages/common"
]