-
-
Notifications
You must be signed in to change notification settings - Fork 754
Expand file tree
/
Copy pathpyproject.toml
More file actions
258 lines (241 loc) · 9.13 KB
/
pyproject.toml
File metadata and controls
258 lines (241 loc) · 9.13 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
[build-system]
requires = ["hatchling>=1.13.0", "hatch-vcs>=0.3.0"]
build-backend = "hatchling.build"
[project]
name = "pybamm"
dynamic = ["version"]
license = { file = "LICENSE.txt" }
description = "Python Battery Mathematical Modelling"
authors = [{ name = "The PyBaMM Team", email = "pybamm@pybamm.org" }]
maintainers = [{ name = "The PyBaMM Team", email = "pybamm@pybamm.org" }]
requires-python = ">=3.10, <3.15"
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.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
]
dependencies = [
"pybammsolvers>=0.6.0,<0.7.0",
"black",
"numpy",
"scipy>=1.11.4",
"xarray>=2022.6.0",
"anytree>=2.8.0",
"sympy>=1.12",
"typing-extensions>=4.10.0",
"pandas>=1.5.0",
"pooch>=1.8.1",
"posthog",
"pyyaml",
"platformdirs",
]
[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/main/CHANGELOG.md"
[project.optional-dependencies]
# For example notebooks
examples = ["jupyter"]
plot = [
# 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 = ["pybtex>=0.25.0"]
# Battery Parameter eXchange format
bpx = ["bpx>=0.5.0,<0.6.0"]
# Low-overhead progress bars
tqdm = ["tqdm"]
jax = ["jax>=0.7.0, <0.9.0; python_version >= '3.11' and (sys_platform != 'darwin' or platform_machine != 'x86_64')"]
# Contains all optional dependencies, except for jax, and dev dependencies
all = [
"scikit-fem>=8.1.0",
"meshio>=5.3.0",
"pybamm[examples,plot,cite,bpx,tqdm]",
]
[dependency-groups]
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-docsearch",
]
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>=9.0",
"pytest-xdist",
"pytest-mock",
"pytest-snapshot",
# For testing Jupyter notebooks
"nbmake",
# To access the metadata for python packages
"importlib-metadata; python_version < '3.10'",
# For property based testing
"hypothesis",
]
[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"
[project.entry-points."pybamm_models"]
SPM = "pybamm.models.full_battery_models.lithium_ion.spm:SPM"
DFN = "pybamm.models.full_battery_models.lithium_ion.dfn:DFN"
SPMe = "pybamm.models.full_battery_models.lithium_ion.spme:SPMe"
MPM = "pybamm.models.full_battery_models.lithium_ion.mpm:MPM"
MSMR = "pybamm.models.full_battery_models.lithium_ion.msmr:MSMR"
NewmanTobias = "pybamm.models.full_battery_models.lithium_ion.newman_tobian:NewmanTobias"
Yang2017 = "pybamm.models.full_battery_models.lithium_ion.Yang2017:Yang2017"
[tool.hatch]
version.source = "vcs"
version.fallback-version = "0.0.0"
build.targets.sdist.include = ["src/pybamm", "CITATION.cff"]
build.hooks.vcs.version-file = "src/pybamm/_version.py"
[tool.repo-review]
ignore = [
"MY", # ignore all MyPy setting checks (MY101, MY103, MY104, MY105, MY106)
"PP004", # ignore the check that prevents an upper cap on Python requires
"PP308", # ignore the explicit pytest summary flag (-ra) check
"PC140", # ignore missing type checker in pre-commit
"PC160", # ignore missing spell checker in pre-commit
"PC180", # ignore missing markdown formatter in pre-commit
"RF102", # ignore the missing isort selection in Ruff configuration
"PP006", # ignore dev dependency group should be defined
"NOX201", # ignore set a script block with dependencies in your noxfile
"NOX202", # ignore noxfile has a shebang line
]
[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
]
[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 = "9.0"
required_plugins = ["pytest-xdist", "pytest-mock"]
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_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"]
# Parse warnings have existed for a while, but became failures in pytest 8.4.0
disable_warnings = ["couldnt-parse", "module-not-measured"]
[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"