-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpyproject.toml
181 lines (163 loc) · 4.72 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
[project]
name = "res-wind-up"
version = "0.1.11"
authors = [
{ name = "Alex Clerc", email = "alex.clerc@res-group.com" }
]
description = "A tool to assess yield uplift of wind turbines"
readme = "README.md"
requires-python = ">=3.9,<4.0"
license = { file = "LICENSE.txt" }
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering"
]
dependencies = [
'eval-type-backport',
'geographiclib',
'matplotlib',
'pandas >= 2.0.0',
'pyarrow',
'pydantic >= 2.0.0',
'python-dotenv',
'pyyaml',
'ruptures',
'scipy',
'seaborn',
'tabulate',
'toml',
'tqdm',
'utm',
]
[project.urls]
Homepage = "https://github.com/resgroup/wind-up"
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project.optional-dependencies]
dev = [
'pytest',
'coverage',
'poethepoet',
'types-pyyaml',
'types-tabulate',
'types-toml',
'types-tqdm',
'types-requests',
'ruff',
'mypy',
'requests',
]
examples = [
'jupyterlab',
'notebook',
'ipywidgets',
'requests',
'ephem',
'flaml[automl]',
]
all = ["res-wind-up[dev,examples]"]
[tool.setuptools.packages.find]
where = ["."]
include = ["wind_up*"]
[tool.ruff]
line-length = 120
show-fixes = true
[tool.ruff.lint]
select = ["ALL"] # https://beta.ruff.rs/docs/rules/
ignore = [
"ANN204", # `__init__` doesn't need annotations
"S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
"PGH004", # Use specific rule codes when using `noqa`. Seems to give false alarms
"COM812", # can conflict with ruff formatter
"ISC001", # can conflict with ruff formatter
"G004", # logging statement can use f-string
"D203", # `incorrect-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
"D213", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
]
[tool.ruff.lint.mccabe]
max-complexity = 12 # try to bring this down to 10
[tool.ruff.lint.pylint]
max-branches = 14 # try to bring this down to 12
max-statements = 66 # try to bring this down to 50
max-args = 17 # try to bring this down to 5
[tool.ruff.lint.per-file-ignores]
"wind_up/models.py" = ["N805", "PERF401"] # try to eliminate this
"tests/**/*.py" = [
"S101", # allow `assert`
"PLR2004", # allow magic values
"D", # TODO: remove this
]
"tests/test_smart_data.py" = ["DTZ001"] # SMART functions use tz naive datetimes
"**/__init__.py" = ["F401"] # ignore unused imports in __init__.py
"examples/**/*.py" = ["T20", "D"]
"examples/**/kelmarsh_kaggle.py" = ["S101","PLR0915","PD013","N806"]
"wind_up/smart_data.py" = ["D"] # RES specific data loading
"wind_up/plots/*.py" = ["D"] # TODO: remove this
"examples/*.ipynb" = ["D"] # Jupyter notebooks
[tool.mypy]
plugins = ["pydantic.mypy"]
exclude = "build|tests|venv|.venv|__ignore__"
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = [
"geographiclib.geodesic",
"pandas",
"pandas.testing",
"ruptures",
"scipy.stats",
"seaborn",
"utm",
"ephem",
"flaml",
"sklearn.*",
]
disable_error_code = ["name-defined"]
ignore_missing_imports = true
[tool.pytest.ini_options]
filterwarnings = [
"error",
"ignore:Passing unrecognized arguments to super:DeprecationWarning", # pycharm debugger issue
"ignore:Passing a BlockManager to DataFrame is deprecated:DeprecationWarning",
]
markers = ["slow: mark test as slow."]
[tool.coverage.report]
omit = [
"wind_up/plots/*.py",
]
exclude_lines = ["if __name__ == .__main__.:"]
[tool.poe.tasks]
[tool.poe.tasks.lint]
help = "Runs formater and linter"
sequence = [
{ cmd = "ruff format ." },
{ cmd = "ruff check . --fix" },
{ cmd = "mypy ." }
]
[tool.poe.tasks.lint-check]
help = "Checks formatter and linter"
sequence = [
{ cmd = "ruff format . --check" },
{ cmd = "ruff check ." },
{ cmd = "mypy ." }
]
[tool.poe.tasks.test-fast]
help = "Runs tests that are not marked as slow"
sequence = [{ cmd = 'python -m pytest -m "not slow"' }]
[tool.poe.tasks.test]
help = "Runs unit tests and show coverage"
sequence = [
{ cmd = "coverage run --source wind_up -m pytest ./tests" },
{ cmd = "coverage report -m" },
]
[tool.poe.tasks.all]
help = "Run all required pre-push commands"
sequence = [{ ref = "lint" }, { ref = "test" }]