-
Notifications
You must be signed in to change notification settings - Fork 13
/
pyproject.toml
311 lines (277 loc) · 7.47 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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "python-cmethods"
dynamic = ["version"]
authors = [
{ name = "Benjamin Thomas Schwertfeger", email = "[email protected]" },
]
maintainers = [
{ name = "Benjamin Thomas Schwertfeger", email = "[email protected]" },
]
description = "A collection of bias correction techniques written in Python - for climate sciences."
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.9"
dependencies = [
"xarray>=2022.11.0",
"netCDF4>=1.6.1",
"numpy",
"click",
"cloup",
]
keywords = [
"climate-science",
"bias",
"bias-correction",
"bias-adjustment",
"climate-reanalysis",
"reanalysis",
"linear-scaling",
"variance-scaling",
"delta-method",
"delta-change-method",
"quantile-mapping",
"quantile-delta-mapping",
]
classifiers = [
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Topic :: Scientific/Engineering",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Unix",
]
[project.scripts]
cmethods = "cmethods:cli"
[project.urls]
"Homepage" = "https://github.com/btschwertfeger/python-cmethods"
"Bug Tracker" = "https://github.com/btschwertfeger/python-cmethods/issues"
[tool.setuptools]
include-package-data = false
[tool.setuptools.packages.find]
include = ["cmethods*"]
exclude = ["doc*", "tests*", "examples*", ".env", "venv"]
[tool.setuptools_scm]
write_to = "cmethods/_version.py"
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"
[tool.pytest]
junit_family = "xunit2"
testpaths = ["tests"]
[tool.pytest.ini_options]
cache_dir = ".cache/pytest"
markers = ["wip: Used to run a specific test by hand."]
addopts = "--maxfail=1"
[tool.coverage.run]
source = ["cmethods"]
omit = ["*tests*"]
concurrency = ["multiprocessing"]
[tool.coverage.report]
exclude_lines = ["coverage: disable", "if TYPE_CHECKING:"]
skip_empty = true
[project.optional-dependencies]
jupyter = ["venv-kernel"]
dev = [
# building
"setuptools_scm",
"build",
# documentation
"sphinx",
"sphinx-rtd-theme",
"nbsphinx",
# linting
"pylint",
"flake8",
"ruff==0.3.5",
# typing
"mypy",
]
test = [
# testing
"pytest",
"pytest-cov",
"zarr",
"dask[distributed]",
"scikit-learn",
"scipy",
]
examples = ["click", "matplotlib"]
[tool.codespell]
check-filenames = true
# ========= T Y P I N G ========================================================
#
[tool.mypy]
python_version = "3.11"
# junit_xml = "mypy.xml"
files = ["cmethods/**/*.py"]
exclude = ["tests/**/*.py"]
cache_dir = ".cache/mypy"
sqlite_cache = true
cache_fine_grained = true
# Disallow dynamic typing
disallow_any_unimported = false
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_generics = false
disallow_subclassing_any = false
# # Untyped definitions and calls
check_untyped_defs = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = false
# None and Optional handling
implicit_optional = true
strict_optional = false
# Configuring warnings
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true
warn_no_return = true
warn_return_any = true
warn_unreachable = true
# Suppressing errors
ignore_errors = false
# Configuring error messages
show_error_context = true
show_column_numbers = true
hide_error_codes = false
pretty = true
color_output = true
show_absolute_path = true
ignore_missing_imports = true
# Miscellaneous strictness flags
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = false
# disable_error_code = xxx,xxx
implicit_reexport = true
strict_concatenate = false
strict_equality = true
strict = true
# ========= L I N T I N G ======================================================
#
[tool.ruff]
# https://beta.ruff.rs/docs/rules/
# https://beta.ruff.rs/docs/settings/
# src = ["cmethods"]
lint.select = [
"A", # flake8-builtins
"AIR", # Airflow
"ASYNC", # flake8-async
"B", # flake8-bugbear
"BLE", # blind-except
"C4", # flake8-comprehensions
"COM", # flake8-commas
"E", # pycodestyle
"F", # pyflakes
"FA", # flake8-future-annotations
"FLY", # flynt
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INT", # flake8-gettext
"ISC", # flake8-implicit-string-concat
"LOG", # flake8-logging
"N", # PEP8 naming
"PERF", # Perflint # maybe
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # PyLint
"PT", # flake8-pytest-style
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flake8-self
"SLOT", # flake8-slots
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"ARG", # flake8-unused-arguments
# "CPY", # flake8-copyright
"FBT", # boolean trap
"PTH", # flake8-use-pathlib
# "FURB", # refurb Path stuff - experimental
# "ERA", # eradicate # commented-out code
# "FIX", # flake8-fixme
# "TD", # flake8-todos
# "TRY", # tryceratops # specify exception messages in class; not important
]
lint.fixable = ["ALL"]
lint.ignore = [
# "B019", # use of lru_cache or cache
# "PLR2004", # magic value in comparison
# "E203", # Whitespace before ':' # false positive on list slices
# "PLR6301", # Method `…` could be a function or static method # false positive for no-self-use
"G002", # lazy logging could be f-string
]
respect-gitignore = true
exclude = []
line-length = 130
cache-dir = ".cache/ruff"
lint.task-tags = ["todo", "TODO"]
[tool.ruff.lint.per-file-ignores]
"cmethods/types.py" = [
"A005", # Shadowing builtin
]
"doc/*.py" = [
# "CPY001", # Missing copyright notice at top of file
"PTH118", # `os.path.join()` should be replaced by `Path` with `/` operator,
"PTH123", # `open()` should be replaced by `Path.open()`
"PTH100", # `os.path.abspath()` should be replaced by `Path.resolve()`
"FURB101", # `open` and `read` should be replaced by `Path("links.rst").read_text(encoding="utf-8")`
"A001", # Variable `copyright` is shadowing a Python builtin
]
"tests/*.py" = [
"E501", # line to long
"F841", # unused variable
"N802", # PEP8 naming
"S101", # assert use
"S110", # try-except-pass without logging
"S311", # pseudo-random-generator
"SLF001", # private member access
"TID252", # ban relative imports
"PTH118", # `os.path.join()` should be replaced by `Path` with `/` operator,
"PTH120", # `os.path.dirname()` should be replaced by `Path.parent`
]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-bandit]
check-typed-exception = true
[tool.ruff.lint.flake8-type-checking]
strict = true
[tool.ruff.lint.pep8-naming]
ignore-names = [
"i",
"j",
"k",
"_",
"X",
"LS_simh",
"LS_simp",
"VS_1_simh",
"VS_1_simp",
"VS_2_simp",
"QDM1",
]
[tool.ruff.lint.pylint]
max-args = 8
max-branches = 15
max-locals = 25
max-returns = 6
max-statements = 50
allow-magic-value-types = ["int"]