-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathpyproject.toml
More file actions
222 lines (201 loc) · 5.21 KB
/
pyproject.toml
File metadata and controls
222 lines (201 loc) · 5.21 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
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
# ╔═══════════════╗
# ║ build / meta ║
# ╚═══════════════╝
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "dapper"
dynamic = ["version"]
description = "DAPPER benchmarks the performance of data assimilation (DA) methods."
readme = "README.md"
license = { text = "MIT" }
authors = [{ name = "Patrick N. Raanes", email = "patrick.n.raanes@gmail.com" }]
requires-python = ">=3.12"
keywords = [
"data-assimilation",
"enkf",
"kalman-filtering",
"state-estimation",
"particle-filter",
"bayesian-methods",
"bayesian-filter",
"chaos",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Mathematics",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
dependencies = [
"scipy>=1.14",
"numpy~=2.0",
"matplotlib>=3.10",
"pyyaml>=6.0.2",
"notebook~=6.5", # Colab uses 6.5.7
"setuptools>=65.5.0", # Appears necessary when installing with uv?
"mpl-tools==0.4.1",
"tqdm~=4.67",
"colorama~=0.4.1",
"tabulate>=0.9",
"pathos~=0.3",
"dill==0.3.8", # NB: use same version on remote computing servers (due to serialisation)
"threadpoolctl>=3.0.0",
"ipywidgets>=8.1.8", # tqdm.auto needs this to be installed
]
[project.optional-dependencies]
Qt = ["PyQt5", "qtpy"]
debug = ["line_profiler", "pre-commit", "ipython>=7.34", "ipdb"]
test = ["pytest", "pytest-cov", "pytest-timeout"]
lint = ["ruff", "ty"]
doc = [
"mkdocs-material",
"mkdocstrings",
"mkdocstrings-python",
"mkdocs-gen-files",
"mkdocs-literate-nav",
"mkdocs-section-index",
"mkdocs-glightbox",
"mkdocs-jupyter",
"pybtex",
"jupytext",
]
dev = ["dapper[debug,test,lint,doc]"]
[project.urls]
Documentation = "https://nansencenter.github.io/DAPPER/"
Source = "https://github.com/nansencenter/DAPPER"
Tracker = "https://github.com/nansencenter/DAPPER/issues"
[tool.hatch.version]
path = "dapper/__init__.py"
[tool.hatch.build.targets.wheel]
packages = ["dapper"]
# ╔═══════╗
# ║ tests ║
# ╚═══════╝
[tool.pytest.ini_options]
minversion = "6.0"
# Since `--doctest-modules` requires specifying `dapper`,
# it means pytest won't discover `test` dir on its own.
# So to run all tests, do `pytest tests`.
addopts = """
--ignore=tests/test_plotting_interactive.py
--ignore=tests/test_demos.py
--doctest-modules dapper
--ignore-glob=**/QG/*
--ignore-glob=**/magic.py
--ignore-glob=**/autoscaler.py
--ignore-glob=**/demo.py
--ignore-glob=**/illust_*.py
--ignore-glob=dapper/mods/KS/compare_schemes.py
--ignore=dapper/mods/explore_props.py
"""
# mpl uses distutils (deprecated in python>=3.10).
# The warning only prints via pytest.
# Silence until mpl is upgraded (when Colab does so).
# dill 0.3.8 accesses numpy.core (deprecated in numpy>=2.0); pinned for remote server compat.
filterwarnings = [
'ignore:distutils:DeprecationWarning',
'ignore:numpy.core is deprecated:DeprecationWarning',
]
[tool.coverage.run]
branch = true # stricter
source = ["dapper"]
#omit = ["bad_file.py"]
[tool.coverage.report]
ignore_errors = true
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
]
# ╔════╗
# ║ ty ║
# ╚════╝
[tool.ty.src]
exclude = [
"tests",
"build",
"docs",
"site",
"dapper/mods",
"scripts",
"dapper/tools/remote/autoscaler.py",
]
[tool.ty.rules]
invalid-method-override = "ignore"
too-many-positional-arguments = "ignore"
# ╔══════╗
# ║ ruff ║
# ╚══════╝
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
"scripts",
".git",
".ipynb_checkpoints",
".pyenv",
".pytest_cache",
".ruff_cache",
".svn",
".venv",
".vscode",
"__pypackages__",
"build",
"dist",
"site-packages",
"venv",
".*",
"README.*",
"docs/examples/*",
"autoscaler.py",
]
# Same as Black.
line-length = 88
indent-width = 4
# Assume Python 3.9
target-version = "py39"
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # Pyflakes
"UP", # pyupgrade
"B", # flake8-bugbear
# "SIM", # flake8-simplify
"I", # isort
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
ignore = [
"B905", # zip w/o explicit `strict=` (active if target-version>=3.10)
]
[tool.ruff.lint.per-file-ignores]
"dapper/da_methods/{ensemble,variational}.py" = [
"B023", # Function definition does not bind loop variable
]
"tests/test_{example_2,data}.py" = [
"E501", # "line too long"
"W291", # "trailing whitespace"
]
"tests/test_plotting_nonempty.py" = [
"E402", # Module level import not at top of file
]
"**/__init__.py" = [
"F401", # "imported but unused"
"E402", # "module level import not at top of file"
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = false
docstring-code-line-length = "dynamic"