-
-
Notifications
You must be signed in to change notification settings - Fork 546
/
pyproject.toml
286 lines (271 loc) · 9.28 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
[build-system]
requires = [
"setuptools>=64",
"wheel",
# On Windows, use the CasADi vcpkg registry and CMake bundled from MSVC
"casadi>=3.6.6; platform_system!='Windows'",
# Note: the version of CasADi as a build-time dependency should be matched
# across platforms, so updates to its minimum version here should be accompanied
# by a version bump in https://github.com/pybamm-team/casadi-vcpkg-registry.
"cmake; platform_system!='Windows'",
]
build-backend = "setuptools.build_meta"
[project]
name = "pybamm"
version = "24.9.0"
license = { file = "LICENSE.txt" }
description = "Python Battery Mathematical Modelling"
authors = [{name = "The PyBaMM Team", email = "[email protected]"}]
maintainers = [{name = "The PyBaMM Team", email = "[email protected]"}]
requires-python = ">=3.9, <3.13"
readme = {file = "README.md", content-type = "text/markdown"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]
dependencies = [
"numpy>=1.23.5,<2.0.0",
"scipy>=1.11.4",
"casadi>=3.6.6",
"xarray>=2022.6.0",
"anytree>=2.8.0",
"sympy>=1.12",
"typing-extensions>=4.10.0",
"pandas>=1.5.0",
"pooch>=1.8.1",
]
[project.urls]
Homepage = "https://pybamm.org"
Documentation = "https://docs.pybamm.org"
Repository = "https://github.com/pybamm-team/PyBaMM"
Releases = "https://github.com/pybamm-team/PyBaMM/releases"
Changelog = "https://github.com/pybamm-team/PyBaMM/blob/develop/CHANGELOG.md"
[project.optional-dependencies]
docs = [
"sphinx>=6",
"sphinx_rtd_theme>=0.5",
"pydata-sphinx-theme",
"sphinx_design",
"sphinx-copybutton",
"myst-parser",
"sphinx-inline-tabs",
"sphinxcontrib-bibtex",
"sphinx-autobuild",
"sphinx-last-updated-by-git",
"nbsphinx",
"ipykernel",
"ipywidgets",
"sphinx-gallery",
"sphinx-hoverxref",
"sphinx-docsearch",
]
# For example notebooks
examples = [
"jupyter",
]
plot = [
"imageio>=2.3.0",
# Note: matplotlib is loaded for debug plots, but to ensure PyBaMM runs
# on systems without an attached display, it should never be imported
# outside of plot() methods.
"matplotlib>=3.6.0",
]
cite = [
"setuptools", # Fix for a pybtex issue
"pybtex>=0.24.0",
]
# Battery Parameter eXchange format
bpx = [
"bpx>=0.4.0",
]
# Low-overhead progress bars
tqdm = [
"tqdm",
]
dev = [
# For working with pre-commit hooks
"pre-commit",
# For code style checks: linting and auto-formatting
"ruff",
# For running testing sessions
"nox",
# For coverage
"pytest-cov",
# For doctest
"pytest-doctestplus",
# pytest and its plugins
"pytest>=6",
"pytest-xdist",
"pytest-mock",
"pytest-subtests",
# For testing Jupyter notebooks
"nbmake",
# To access the metadata for python packages
"importlib-metadata; python_version < '3.10'",
]
# For the Jax solver.
# Note: These must be kept in sync with the versions defined in pybamm/util.py, and
# must remain compatible with IREE (see noxfile.py for IREE compatibility).
jax = [
"jax==0.4.27",
"jaxlib==0.4.27",
]
# For MLIR expression evaluation (IDAKLU Solver)
iree = [
# must be pip installed with --find-links=https://iree.dev/pip-release-links.html
"iree-compiler==20240507.886", # see IREE compatibility notes in noxfile.py
]
# Contains all optional dependencies, except for jax, iree, and dev dependencies
all = [
"scikit-fem>=8.1.0",
"pybamm[examples,plot,cite,bpx,tqdm]",
]
[project.entry-points."pybamm_parameter_sets"]
Sulzer2019 = "pybamm.input.parameters.lead_acid.Sulzer2019:get_parameter_values"
Ai2020 = "pybamm.input.parameters.lithium_ion.Ai2020:get_parameter_values"
Chen2020 = "pybamm.input.parameters.lithium_ion.Chen2020:get_parameter_values"
Chen2020_composite = "pybamm.input.parameters.lithium_ion.Chen2020_composite:get_parameter_values"
Ecker2015 = "pybamm.input.parameters.lithium_ion.Ecker2015:get_parameter_values"
Ecker2015_graphite_halfcell = "pybamm.input.parameters.lithium_ion.Ecker2015_graphite_halfcell:get_parameter_values"
Marquis2019 = "pybamm.input.parameters.lithium_ion.Marquis2019:get_parameter_values"
Mohtat2020 = "pybamm.input.parameters.lithium_ion.Mohtat2020:get_parameter_values"
NCA_Kim2011 = "pybamm.input.parameters.lithium_ion.NCA_Kim2011:get_parameter_values"
OKane2022 = "pybamm.input.parameters.lithium_ion.OKane2022:get_parameter_values"
OKane2022_graphite_SiOx_halfcell = "pybamm.input.parameters.lithium_ion.OKane2022_graphite_SiOx_halfcell:get_parameter_values"
ORegan2022 = "pybamm.input.parameters.lithium_ion.ORegan2022:get_parameter_values"
Prada2013 = "pybamm.input.parameters.lithium_ion.Prada2013:get_parameter_values"
Ramadass2004 = "pybamm.input.parameters.lithium_ion.Ramadass2004:get_parameter_values"
Xu2019 = "pybamm.input.parameters.lithium_ion.Xu2019:get_parameter_values"
ECM_Example = "pybamm.input.parameters.ecm.example_set:get_parameter_values"
MSMR_Example = "pybamm.input.parameters.lithium_ion.MSMR_example_set:get_parameter_values"
Chayambuka2022 = "pybamm.input.parameters.sodium_ion.Chayambuka2022:get_parameter_values"
[tool.setuptools]
include-package-data = true
# List of files to include as package data. These are mainly the parameter CSV files in
# the input/parameters/ subdirectories. Other files such as the CITATIONS file, relevant
# README.md files, and specific .txt files inside the pybamm/ directory are also included.
# These are specified to be included in the SDist through MANIFEST.in.
[tool.setuptools.package-data]
pybamm = [
"*.txt",
"*.md",
"*.csv",
"*.py",
"src/pybamm/CITATIONS.bib",
"src/pybamm/plotting/mplstyle",
]
[tool.setuptools.packages.find]
where = ["src"]
[tool.ruff]
extend-include = ["*.ipynb"]
extend-exclude = ["__init__.py"]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
# "I", # isort
# "ARG", # flake8-unused-arguments
# "C4", # flake8-comprehensions
# "ICN", # flake8-import-conventions
# "ISC", # flake8-implicit-str-concat
# "PGH", # pygrep-hooks
# "PIE", # flake8-pie
# "PL", # pylint
# "PT", # flake8-pytest-style
# "PTH", # flake8-use-pathlib
# "RET", # flake8-return
"RUF", # Ruff-specific
# "SIM", # flake8-simplify
# "T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"TID252", # relative-imports
"S101", # to identify use of assert statement
"PT027", # remove unittest style assertion
"PT009", # Use pytest.raises instead of unittest-style
]
ignore = [
"E741", # Ambiguous variable name
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"SIM108", # Use ternary operator
"ARG001", # Unused function argument:
"ARG002", # Unused method arguments
"PLR2004", # Magic value used in comparison
"PLR0915", # Too many statements
"PLR0913", # Too many arguments
"PLR0912", # Too many branches
"RET504", # Unnecessary assignment
"RET505", # Unnecessary `else`
"RET506", # Unnecessary `elif`
"B018", # Found useless expression
"RUF002", # Docstring contains ambiguous
"UP007", # For pyupgrade
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["T20", "S101"]
"docs/*" = ["T20"]
"examples/*" = ["T20"]
"**.ipynb" = ["E402", "E703"]
"docs/source/examples/notebooks/models/lithium-plating.ipynb" = ["F821"]
[tool.pytest.ini_options]
minversion = "8"
# Use pytest-xdist to run tests in parallel by default, exit with
# error if not installed
required_plugins = [
"pytest-xdist",
"pytest-mock",
"pytest-subtests",
]
norecursedirs = 'pybind11*'
addopts = [
"-nauto",
"-vra",
"--strict-config",
"--strict-markers",
]
testpaths = [
"tests",
]
console_output_style = "progress"
xfail_strict = true
filterwarnings = [
"error",
# ignore internal nbmake warnings
'ignore:unclosed \<socket.socket:ResourceWarning',
'ignore:unclosed event loop \<:ResourceWarning',
# ignore warnings generated while running tests
"ignore::DeprecationWarning",
"ignore::UserWarning",
"ignore::RuntimeWarning",
]
# Logging configuration
log_cli = "true"
log_cli_level = "INFO"
log_format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
[tool.coverage.run]
source = ["src/pybamm"]
concurrency = ["multiprocessing"]
[tool.repo-review]
ignore = [
"PP003" # list wheel as a build-dep
]
[tool.mypy]
ignore_missing_imports = true
allow_redefinition = true
disable_error_code = ["call-overload", "operator"]
[[tool.mypy.overrides]]
module = [
"pybamm.models.base_model.*",
"pybamm.models.full_battery_models.base_battery_model.*"
]
disable_error_code = "attr-defined"