forked from PyPSA/PyPSA
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
267 lines (237 loc) · 6.78 KB
/
pyproject.toml
File metadata and controls
267 lines (237 loc) · 6.78 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
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
# SPDX-FileCopyrightText: PyPSA Contributors
#
# SPDX-License-Identifier: MIT
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
[project]
name="pypsa"
dynamic = ["version"]
description="Python for Power Systems Analysis"
readme="README.md"
authors=[{name = "PyPSA Developers, see https://docs.pypsa.org/latest/contributing/contributors.html", email = "t.brown@tu-berlin.de"}]
license = { file = "LICENSE" }
classifiers=[
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Typing :: Typed",
"Operating System :: OS Independent",
]
requires-python = ">=3.11"
dependencies = [
"numpy",
"scipy",
"pandas>=0.24",
"xarray",
"netcdf4!=1.7.4", # See https://github.com/PyPSA/PyPSA/issues/1510
"linopy>=0.5.5",
"matplotlib",
"plotly",
"pydeck>=0.6",
"seaborn",
"geopandas>=0.9",
"shapely",
"networkx>=2",
"deprecation",
"validators",
"highspy",
"levenshtein>=0.27.1",
]
[project.urls]
Homepage = "https://github.com/PyPSA/PyPSA"
Source = "https://github.com/PyPSA/PyPSA"
Documentation = "https://docs.pypsa.org"
[project.optional-dependencies]
hdf5 = ["tables"]
cartopy = ["cartopy>=0.16"]
excel = ["openpyxl", "python-calamine"]
gurobipy = ["gurobipy"]
cloudpath = ["cloudpathlib"]
dev = [
"pytest",
"pytest-cov",
"pytest-mpl",
"coverage",
"pypower",
"pandapower>=2.14.11",
"scikit-learn",
"pre-commit",
"ruff",
"mypy",
"jupyter>=1.1.1",
"typing-extensions>=4.14.0",
"reuse>=5.1.1",
]
docs = [
"mkdocs-material",
"mkdocs-ezlinks-plugin",
"mkdocs-autolinks-plugin",
"mkdocs-redirects",
"mkdocs-video",
"mkdocs-git-revision-date-localized-plugin",
"mkdocs-table-reader-plugin",
"mkdocstrings-python",
"mkdocs-jupyter",
"cairosvg",
"pillow",
"tsam",
"gurobipy",
"openpyxl",
"python-calamine",
]
# setuptools_scm settings
[tool.setuptools_scm]
version_scheme = "no-guess-dev"
[tool.setuptools.packages.find]
include = ["pypsa"]
[tool.setuptools.package-data]
"pypsa" = ["py.typed"]
# Pytest settings
[tool.pytest.ini_options]
filterwarnings = [
# Raise warnings as errors
"error::DeprecationWarning",
"error::FutureWarning",
"error::RuntimeWarning",
"error::UserWarning",
# Ignore internal warnings
"default:With PyPSA 1.0, the API for how to access components data has changed:DeprecationWarning",
"default:When combining.*with other plots on a geographical axis.*:UserWarning", # TODO: needs to be checked
# Ignore linopy warnings
"default:Coordinates across variables not equal. Perform outer join.:UserWarning",
"ignore:In a future version of xarray the default value for join will change:FutureWarning",
]
markers = [
"mpl_image_compare",
]
# Coverage settings
[tool.coverage.run]
branch = true
source = ["pypsa"]
omit = ["test/*"]
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
]
# Static type checker settings
[tool.mypy]
exclude = ['dev/*', 'examples/*', 'docs/*']
ignore_missing_imports = true
no_implicit_optional = true
warn_unused_ignores = true
show_error_code_links = true
# Maybe activate at later stage
# disallow_any_generics = true
# warn_return_any = true
[[tool.mypy.overrides]]
module = "pypsa.*"
disallow_untyped_defs = true
check_untyped_defs = true
[[tool.mypy.overrides]]
module = "cloudpathlib.*"
ignore_errors = true
follow_imports = "skip"
# Remove when typing in linopy are resolved
[[tool.mypy.overrides]]
module = "linopy.*"
ignore_errors = true
follow_imports = "skip"
# Formatter and linter settings
[tool.ruff]
extend-include = ['*.ipynb']
[tool.ruff.lint]
select = [
'F', # pyflakes
'E', # pycodestyle: Error
'W', # pycodestyle: Warning
'I', # isort
'D', # pydocstyle
'UP', # pyupgrade
'PL', # pylint
'PERF', # perflint
'ANN', # flake-8 annotations
'ASYNC', # flake8-async
'TID', # flake8-tidy-imports
'S', # flake8-bandit
'B', # flake8-bugbear
'C4', # flake8-comprehensions
'EM', # flake8-errmsg
'G', # flake8-logging-format
'PIE', # flake8-pie
'T20', # flake8-print
'PYI', # flake8-pyi
'PT', # flake8-pytest-style
'SIM', # flake8-simplify
'TC', # flake8-tidy-checking
# 'ARG', # flake8-unused-arguments
'PTH', # flake8-use-pathlib
'NPY', # numpy
'RUF013', # ruff
'ERA', # eradicate
'TRY' # tryceratops
]
# Include once available
# https://github.com/astral-sh/ruff/issues/2310
ignore = [
'ANN401', # Dynamically typed expressions are forbidden
'E501', # line too long
'E741', # ambiguous variable names
'D203', # 1 blank line required before class docstring
'D213', # Multi-line docstring summary should start at the second line
'D400', # First line should end with a period
'D415', # First line should end with a period, question mark, or exclamation point
'SIM105',
'SIM108',
'SIM118',
'PLR0911',
'PLR0913',
'PLR0915',
'PLR2004',
# Could be implemented
'PLW1641',
'PLR0912',
'PT011',
'PLW2901',
'ERA001', #TODO add again
]
[tool.ruff.lint.per-file-ignores]
"{test,examples,doc,docs}/**" = [
'D', # pydocstyle
'ERA', # eradicate
'S', # flake8-bandit
'B', # flake8-bugbear
'EM', # flake8-errmsg
'T20', # flake8-print
'SIM', # flake8-simplify
'ARG', # flake8-unused-arguments
'PL', # pylint
'TRY' # tryceratops
]
# Ignore for test files
"{test/**}" = [
'D100', # Missing docstring in public module
'D101', # Missing docstring in public class
'D102', # Missing docstring in public method
'D103', # Missing docstring in public function
'D105', # Missing docstring in magic method
'D107', # Missing docstring in __init__
'D200', # One-line docstring should fit on one line with quotes
'D205', # 1 blank line required between summary line and description
'D404', # First word of the docstring should not be "This
'D413', # Missing blank line after last section
'D415', # First line should end with a period, question mark, or exclamation point
'D417', # Missing argument descriptions in the docstring
]
"{test,examples,docs}/**"=[
'ANN' # flake8-annotations
]
[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"