-
Notifications
You must be signed in to change notification settings - Fork 47
/
pyproject.toml
194 lines (174 loc) · 5.02 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
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "earth2mip"
authors = [
{ name="NVIDIA Research" },
{ name="NVIDIA Modulus Team" },
]
description = "Earth-2 Model Intercomparison Project (MIP) is a python framework that enables climate researchers and scientists to explore and experiment with AI models for weather and climate."
readme = "README.md"
requires-python = ">=3.10"
license = {text = "Apache 2.0"}
dependencies = [
"altair>=4.2.2",
"boto3>=1.26.0",
"cdsapi >= 0.6.1",
"cfgrib >= 0.9.10.3",
"cftime",
"dask>=2023.1.0",
"distributed>=2023.1.0",
"eccodes>=1.4.0",
"ecmwflibs>=0.5.2",
"ecmwf-opendata>=0.2.0",
"einops",
"fsspec",
"h5py>=3.2.0",
"h5netcdf>=1.0.0",
"importlib_metadata>=6.7.0",
"joblib>=1.1.0",
"loguru>=0.6.0",
"netCDF4>=1.6.4",
"numpy",
"nvidia-modulus >= 0.7.0",
"pandas>=1.5.3",
"properscoring>=0.1",
"pydantic >= 1.10, <=1.10.11",
"pytest-timeout >= 2.1.0",
"pytest-asyncio >= 0.21.0",
"pytest-regtest",
"pytest>=7.0.0",
"python-dotenv>=1.0.0",
"s3fs",
"setuptools >= 38.4", # For pkg_resources
"torch>=1.13",
"torch_harmonics>=0.5.0",
"tqdm>=4.65.0",
"typer",
"xarray",
"xskillscore >= 0.0.24",
"zarr>=2.14.2",
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
]
dynamic = ["version"]
[project.optional-dependencies]
pangu = [
"onnxruntime-gpu>=1.15.1",
]
graphcast = [
"flax==0.7.3",
"jax==0.4.16",
"graphcast @ https://github.com/deepmind/graphcast/archive/e622a15c1b9742d78f9b662f2af262604d58c204.tar.gz",
"gcsfs",
]
dev = [
"pre-commit>=3.0.0",
"pyyaml>=6.0",
"black==22.10.0",
"interrogate==1.5.0",
"coverage>=7.2.0",
"ruff==0.1.5",
]
docs = [
"cartopy",
"sphinx>=6.0.0",
"jupytext>=1.15.0",
"sphinx-autodoc-typehints>=1.24.0",
"sphinx-gallery>=0.12.0",
"myst-parser>=0.18.0",
"sphinx-favicon>=1.0.1",
"pydata-sphinx-theme==0.14.3",
]
[project.entry-points."earth2mip.networks"]
fcn = "earth2mip.networks.fcn:load"
dlwp = "earth2mip.networks.dlwp:load"
pangu = "earth2mip.networks.pangu:load"
pangu_6 = "earth2mip.networks.pangu:load_6"
pangu_24 = "earth2mip.networks.pangu:load_24"
fcnv2_sm = "earth2mip.networks.fcnv2_sm:load"
graphcast = "earth2mip.networks.graphcast:load_time_loop"
graphcast_operational = "earth2mip.networks.graphcast:load_time_loop_operational"
graphcast_small = "earth2mip.networks.graphcast:load_time_loop_small"
[tool.setuptools.dynamic]
version = {attr = "earth2mip.__version__"}
[tool.setuptools.packages.find]
include = ["earth2mip", "earth2mip.*"]
# ==== RUFF configuration (flake8, bandit, isort) ====
[tool.ruff]
# Enable flake8/pycodestyle (`E`), Pyflakes (`F`), flake8-bandit (`S`),
# isort (`I`), and performance 'PERF' rules.
select = ["E", "F", "S", "I", "PERF"]
fixable = ["I"]
# Never enforce `E402`, `E501` (line length violations),
# and `S311` (random number generators)
# `S310` (URL audit, TODO fix this)
# `S101` assert not allowed
ignore = ["E501", "S311", "S310", "S101"]
[tool.ruff.per-file-ignores]
# Ignore `F401` (import violations) in all `__init__.py` files, and in `docs/*.py`.
"__init__.py" = ["F401"]
"docs/*.py" = ["F401"]
# Ignore `S101` (assertions) in all `test` files.
"test/*.py" = ["S101"]
# Ignore `E402` (imports at top of file) for example scripts
"examples/*.py" = ["E402", "I001"]
# For network arch code
# Ignore `E741` (ambigious variable names)
# Ignore `PERF401` (use list compression)
"earth2mip/networks/fcnv2/*.py" = ["E741", "PERF401"]
[tool.pytest.ini_options]
testpaths = ["test"]
norecursedirs = [".git", "third_party"]
addopts = ["-vv", "-r", "xfXs"]
markers = [
"slow: marks tests as slow (deselect with: -m 'not slow')",
"cli: marks tests which run CLIs"
]
asyncio_mode = "auto"
# ==== Coverage.py configuration (ran using pytest-cov) ====
# See: https://coverage.readthedocs.io/en/latest/config.html
[tool.coverage.run]
branch = true
concurrency = ["multiprocessing", "thread"]
source = ["earth2mip"]
omit = [
"third_party/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
]
exclude_also = [
# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]
omit = [
# omit anything in a .local directory anywhere
"test/*",
# omit fcn arch
"earth2mip/networks/fcnv2/*",
]
show_missing = true
fail_under = 20
[tool.coverage.xml]
output = "e2mip.coverage.xml"
# ==== MyPy configuration ====
# See: https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
python_version = "3.10"
packages = ['earth2mip']
exclude = [
'^(examples|test|docs)'
]
disallow_untyped_calls = true
disallow_untyped_defs = true
check_untyped_defs = true
implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
follow_imports = 'skip' # TODO: Should eventually shut off