batmods-lite 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. batmods_lite-0.0.2/LICENSE +28 -0
  2. batmods_lite-0.0.2/MANIFEST.in +1 -0
  3. batmods_lite-0.0.2/PKG-INFO +143 -0
  4. batmods_lite-0.0.2/README.md +91 -0
  5. batmods_lite-0.0.2/pyproject.toml +108 -0
  6. batmods_lite-0.0.2/setup.cfg +4 -0
  7. batmods_lite-0.0.2/src/batmods_lite.egg-info/PKG-INFO +143 -0
  8. batmods_lite-0.0.2/src/batmods_lite.egg-info/SOURCES.txt +51 -0
  9. batmods_lite-0.0.2/src/batmods_lite.egg-info/dependency_links.txt +1 -0
  10. batmods_lite-0.0.2/src/batmods_lite.egg-info/requires.txt +28 -0
  11. batmods_lite-0.0.2/src/batmods_lite.egg-info/top_level.txt +1 -0
  12. batmods_lite-0.0.2/src/bmlite/P2D/__init__.py +25 -0
  13. batmods_lite-0.0.2/src/bmlite/P2D/_simulation.py +444 -0
  14. batmods_lite-0.0.2/src/bmlite/P2D/_solutions.py +647 -0
  15. batmods_lite-0.0.2/src/bmlite/P2D/dae.py +351 -0
  16. batmods_lite-0.0.2/src/bmlite/P2D/domains.py +659 -0
  17. batmods_lite-0.0.2/src/bmlite/P2D/postutils.py +496 -0
  18. batmods_lite-0.0.2/src/bmlite/P2D/submodels.py +140 -0
  19. batmods_lite-0.0.2/src/bmlite/P2D/templates/graphiteSiOx_nmc811.yaml +54 -0
  20. batmods_lite-0.0.2/src/bmlite/P2D/templates/graphite_lfp.yaml +59 -0
  21. batmods_lite-0.0.2/src/bmlite/P2D/templates/graphite_nmc532.yaml +54 -0
  22. batmods_lite-0.0.2/src/bmlite/SPM/__init__.py +25 -0
  23. batmods_lite-0.0.2/src/bmlite/SPM/_simulation.py +437 -0
  24. batmods_lite-0.0.2/src/bmlite/SPM/_solutions.py +552 -0
  25. batmods_lite-0.0.2/src/bmlite/SPM/dae.py +194 -0
  26. batmods_lite-0.0.2/src/bmlite/SPM/domains.py +458 -0
  27. batmods_lite-0.0.2/src/bmlite/SPM/postutils.py +279 -0
  28. batmods_lite-0.0.2/src/bmlite/SPM/submodels.py +140 -0
  29. batmods_lite-0.0.2/src/bmlite/SPM/templates/graphiteSiOx_nmc811.yaml +37 -0
  30. batmods_lite-0.0.2/src/bmlite/SPM/templates/graphite_lfp.yaml +42 -0
  31. batmods_lite-0.0.2/src/bmlite/SPM/templates/graphite_nmc532.yaml +37 -0
  32. batmods_lite-0.0.2/src/bmlite/__init__.py +55 -0
  33. batmods_lite-0.0.2/src/bmlite/_core/__init__.py +18 -0
  34. batmods_lite-0.0.2/src/bmlite/_core/_constants.py +17 -0
  35. batmods_lite-0.0.2/src/bmlite/_core/_experiment.py +291 -0
  36. batmods_lite-0.0.2/src/bmlite/_core/_idasolver.py +116 -0
  37. batmods_lite-0.0.2/src/bmlite/_core/_templates.py +55 -0
  38. batmods_lite-0.0.2/src/bmlite/_utils.py +193 -0
  39. batmods_lite-0.0.2/src/bmlite/materials/__init__.py +29 -0
  40. batmods_lite-0.0.2/src/bmlite/materials/_gen2_electrolyte.py +136 -0
  41. batmods_lite-0.0.2/src/bmlite/materials/_graphite.py +329 -0
  42. batmods_lite-0.0.2/src/bmlite/materials/_graphite_SiOx.py +274 -0
  43. batmods_lite-0.0.2/src/bmlite/materials/_lfp.py +152 -0
  44. batmods_lite-0.0.2/src/bmlite/materials/_nmc_532.py +301 -0
  45. batmods_lite-0.0.2/src/bmlite/materials/_nmc_811.py +272 -0
  46. batmods_lite-0.0.2/src/bmlite/materials/data/graphite_ocv.csv +257 -0
  47. batmods_lite-0.0.2/src/bmlite/materials/data/graphite_ocv_extrap.csv +258 -0
  48. batmods_lite-0.0.2/src/bmlite/materials/data/lfp_ocv.csv +255 -0
  49. batmods_lite-0.0.2/src/bmlite/materials/data/nmc532_ocv.csv +222 -0
  50. batmods_lite-0.0.2/src/bmlite/materials/data/nmc532_ocv_extrap.csv +227 -0
  51. batmods_lite-0.0.2/src/bmlite/mathutils.py +280 -0
  52. batmods_lite-0.0.2/src/bmlite/mesh.py +200 -0
  53. batmods_lite-0.0.2/src/bmlite/plotutils/__init__.py +69 -0
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Alliance for Energy Innovation, LLC
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1 @@
1
+ global-exclude tests/*
@@ -0,0 +1,143 @@
1
+ Metadata-Version: 2.4
2
+ Name: batmods-lite
3
+ Version: 0.0.2
4
+ Summary: Packaged battery models and material properties.
5
+ Author: Corey R. Randall
6
+ Author-email: corey.r.randall@gmail.com
7
+ Maintainer: Corey R. Randall
8
+ Maintainer-email: corey.r.randall@gmail.com
9
+ License-Expression: BSD-3-Clause
10
+ Project-URL: Homepage, https://github.com/NatLabRockies/batmods-lite
11
+ Project-URL: Documentation, https://batmods-lite.readthedocs.io/
12
+ Project-URL: Repository, https://github.com/NatLabRockies/batmods-lite
13
+ Project-URL: Issues, https://github.com/NatLabRockies/batmods-lite/issues
14
+ Keywords: battery,models,lithium,NMC,LFP,SPM,P2D
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Requires-Python: <3.15,>=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: tqdm
27
+ Requires-Dist: numpy
28
+ Requires-Dist: scipy
29
+ Requires-Dist: pandas
30
+ Requires-Dist: openpyxl
31
+ Requires-Dist: matplotlib
32
+ Requires-Dist: ruamel.yaml
33
+ Requires-Dist: scikit-sundae>=1.1.3
34
+ Provides-Extra: docs
35
+ Requires-Dist: sphinx; extra == "docs"
36
+ Requires-Dist: myst-nb; extra == "docs"
37
+ Requires-Dist: sphinx-design; extra == "docs"
38
+ Requires-Dist: sphinx-autoapi; extra == "docs"
39
+ Requires-Dist: sphinx-copybutton; extra == "docs"
40
+ Requires-Dist: pydata-sphinx-theme; extra == "docs"
41
+ Provides-Extra: tests
42
+ Requires-Dist: pytest; extra == "tests"
43
+ Requires-Dist: pytest-cov; extra == "tests"
44
+ Requires-Dist: pytest-html; extra == "tests"
45
+ Requires-Dist: pytest-xdist; extra == "tests"
46
+ Provides-Extra: dev
47
+ Requires-Dist: nox; extra == "dev"
48
+ Requires-Dist: ruff; extra == "dev"
49
+ Requires-Dist: codespell; extra == "dev"
50
+ Requires-Dist: batmods-lite[docs,tests]; extra == "dev"
51
+ Dynamic: license-file
52
+
53
+ <!-- <img alt='Logo' style='width: 75%; min-width: 250px; max-width: 500px;'
54
+ src='https://github.com/NatLabRockies/batmods-lite/blob/main/images/dark.png?raw=true#gh-dark-mode-only'/>
55
+ <img alt='Logo' style='width: 75%; min-width: 250px; max-width: 500px;'
56
+ src='https://github.com/NatLabRockies/batmods-lite/blob/main/images/light.png?raw=true#gh-light-mode-only'/> -->
57
+
58
+ # BATMODS-lite
59
+
60
+ [![ci](https://github.com/NatLabRockies/batmods-lite/actions/workflows/ci.yml/badge.svg)](https://github.com/NatLabRockies/batmods-lite/actions/workflows/ci.yml) &nbsp;
61
+ [![license](https://img.shields.io/badge/license-BSD--3-blue.svg)](https://github.com/NatLabRockies/batmods-lite/blob/main/LICENSE) &nbsp;
62
+ [![codecov](https://codecov.io/gh/NatLabRockies/batmods-lite/graph/badge.svg?token=MPuSOeIurf)](https://codecov.io/gh/NatLabRockies/batmods-lite) &nbsp;
63
+ [![pypi](https://img.shields.io/pypi/v/batmods-lite)](https://pypi.org/project/batmods-lite) &nbsp;
64
+ <!-- [![downloads](https://static.pepy.tech/personalized-badge/batmods-lite?period=total&units=INTERNATIONAL_SYSTEM&left_color=GREY&right_color=BRIGHTGREEN&left_text=pypi|downloads)](https://pepy.tech/projects/batmods-lite) -->
65
+
66
+ ## Summary
67
+ Battery Analysis and Training Models for Optimization and Design Studies (BATMODS) is a Python package with an API for pre-built battery models. The original purpose of the package was to quickly generate synthetic data for machine learning models to train with. However, the models are generally useful for any battery simulations or analysis. `BATMODS-lite` includes the following:
68
+
69
+ 1) A library and API for pre-built battery models
70
+ 2) Kinetic/transport properties for common battery materials
71
+
72
+ Note that the package focuses on phsics-based models like the single-particle (SPM) and pseudo-2D (P2D) model. If you enjoy the interface but are looking to run equivalent circuit models (ECMs), you should check out [thevenin](https://github.com/NatLabRockies/thevenin), which is distributed separately, but is developed and maintained by the same team. Consequently, the interface to `thevenin` models is intentionally similar, allowing for a smooth transition between physics-based and ECM approaches.
73
+
74
+ ## Installation
75
+ `BATMODS-lite` can be installed from [PyPI](https://pypi.org/project/batmods-lite) using the following command:
76
+
77
+ ```
78
+ pip install batmods-lite
79
+ ```
80
+
81
+ If you run into issues with installation due to the [scikit-sundae](https://github.com/NatLabRockies/scikit-sundae) dependency, please submit an issue [here](https://github.com/NatLabRockies/scikit-sundae/issues). We also manage this solver package, but distribute it separately since it is not developed in pure Python.
82
+
83
+ For those interested in setting up a developer and/or editable version of this software, please see the directions available in the "Development" section of our [documentation](https://batmods-lite.readthedocs.io/en/latest/development).
84
+
85
+ ## Get Started
86
+ The API is organized around three main classes that allow you to construct simulations, define experiments, and interact with solutions. Two basic examples are given below. These demonstrate a 2C discharge for both the single particle model (SPM) and pseudo-2D (P2D) model. Note that the experiment class interfaces with all simulations. The simulations and their respective solutions, however, will depend on the model subpackage they are loaded from. For more detailed examples, check out the [documentation](https://batmods-lite.readthedocs.io) on Read the Docs. Note that while the full name of the package is `batmods-lite`, the installed module is imported using `bmlite`.
87
+
88
+ ```python
89
+ # Single particle model example
90
+ import bmlite as bm
91
+
92
+ sim = bm.SPM.Simulation()
93
+
94
+ expr = bm.Experiment()
95
+ expr.add_step('current_C', 2., (1350., 10.))
96
+
97
+ soln = sim.run(expr)
98
+ soln.simple_plot('time_s', 'voltage_V')
99
+ ```
100
+
101
+ ```python
102
+ # Pseudo-2D model example
103
+ import bmlite as bm
104
+
105
+ sim = bm.P2D.Simulation()
106
+
107
+ expr = bm.Experiment()
108
+ expr.add_step('current_C', 2., (1350., 10.))
109
+
110
+ soln = sim.run(expr)
111
+ soln.simple_plot('time_s', 'voltage_V')
112
+ ```
113
+
114
+ **Notes:**
115
+ * If you are new to Python, check out [Spyder IDE](https://www.spyder-ide.org/). Spyder is a powerful interactive development environment (IDE) that can make programming in Python more approachable to new users.
116
+ * Another friendly option for getting started in Python is to use [Jupyter Notebooks](https://jupyter.org/). We write our examples in Jupyter Notebooks since they support both markdown blocks for explanations and executable code blocks.
117
+ * Python, Spyder, and Jupyter Notebooks can be setup using [Anaconda](https://www.anaconda.com/download/success). Anaconda provides a convenient way for new users to get started with Python due to its friendly graphical installer and environment manager.
118
+
119
+ ## Citing this Work
120
+ This work was authored by researchers at the National Laboratory of the Rockies (NLR). If you use this package in your work, please include the following citation:
121
+
122
+ > Randall, Corey R. "BATMODS-lite: Packaged battery models and material properties [SWR-25-108]." Computer software, Jun. 2025. url: [github.com/NatLabRockies/batmods-lite](https://github.com/NatLabRockies/batmods-lite). doi: [10.11578/dc.20260114.1](https://doi.org./10.11578/dc.20260114.1).
123
+
124
+ For convenience, we also provide the following for your BibTex:
125
+
126
+ ```
127
+ @misc{randall2025bmlite,
128
+ author = {Randall, Corey R.},
129
+ title = {{BATMODS-lite: Packaged battery models and material properties [SWR-25-108]}},
130
+ url = {github.com/NatLabRockies/batmods-lite},
131
+ month = {Jun.},
132
+ year = {2025},
133
+ doi = {10.11578/dc.20260114.1},
134
+ }
135
+ ```
136
+
137
+ ## Contributing
138
+ If you'd like to contribute to this package, please look through the existing [issues](https://github.com/NatLabRockies/batmods-lite/issues). If the bug you've caught or the feature you'd like to add isn't already being worked on, please submit a new issue before getting started.
139
+
140
+ <!-- You should also read through the [developer guidelines](https://batmods-lite.readthedocs.io/latest/development). Need to get on readthedocs first... -->
141
+
142
+ ## Disclaimer
143
+ This work was authored by the National Laboratory of the Rockies (NLR), operated by Alliance for Energy Innovation, LLC, for the U.S. Department of Energy (DOE). The views expressed in the repository do not necessarily represent the views of the DOE or the U.S. Government.
@@ -0,0 +1,91 @@
1
+ <!-- <img alt='Logo' style='width: 75%; min-width: 250px; max-width: 500px;'
2
+ src='https://github.com/NatLabRockies/batmods-lite/blob/main/images/dark.png?raw=true#gh-dark-mode-only'/>
3
+ <img alt='Logo' style='width: 75%; min-width: 250px; max-width: 500px;'
4
+ src='https://github.com/NatLabRockies/batmods-lite/blob/main/images/light.png?raw=true#gh-light-mode-only'/> -->
5
+
6
+ # BATMODS-lite
7
+
8
+ [![ci](https://github.com/NatLabRockies/batmods-lite/actions/workflows/ci.yml/badge.svg)](https://github.com/NatLabRockies/batmods-lite/actions/workflows/ci.yml) &nbsp;
9
+ [![license](https://img.shields.io/badge/license-BSD--3-blue.svg)](https://github.com/NatLabRockies/batmods-lite/blob/main/LICENSE) &nbsp;
10
+ [![codecov](https://codecov.io/gh/NatLabRockies/batmods-lite/graph/badge.svg?token=MPuSOeIurf)](https://codecov.io/gh/NatLabRockies/batmods-lite) &nbsp;
11
+ [![pypi](https://img.shields.io/pypi/v/batmods-lite)](https://pypi.org/project/batmods-lite) &nbsp;
12
+ <!-- [![downloads](https://static.pepy.tech/personalized-badge/batmods-lite?period=total&units=INTERNATIONAL_SYSTEM&left_color=GREY&right_color=BRIGHTGREEN&left_text=pypi|downloads)](https://pepy.tech/projects/batmods-lite) -->
13
+
14
+ ## Summary
15
+ Battery Analysis and Training Models for Optimization and Design Studies (BATMODS) is a Python package with an API for pre-built battery models. The original purpose of the package was to quickly generate synthetic data for machine learning models to train with. However, the models are generally useful for any battery simulations or analysis. `BATMODS-lite` includes the following:
16
+
17
+ 1) A library and API for pre-built battery models
18
+ 2) Kinetic/transport properties for common battery materials
19
+
20
+ Note that the package focuses on phsics-based models like the single-particle (SPM) and pseudo-2D (P2D) model. If you enjoy the interface but are looking to run equivalent circuit models (ECMs), you should check out [thevenin](https://github.com/NatLabRockies/thevenin), which is distributed separately, but is developed and maintained by the same team. Consequently, the interface to `thevenin` models is intentionally similar, allowing for a smooth transition between physics-based and ECM approaches.
21
+
22
+ ## Installation
23
+ `BATMODS-lite` can be installed from [PyPI](https://pypi.org/project/batmods-lite) using the following command:
24
+
25
+ ```
26
+ pip install batmods-lite
27
+ ```
28
+
29
+ If you run into issues with installation due to the [scikit-sundae](https://github.com/NatLabRockies/scikit-sundae) dependency, please submit an issue [here](https://github.com/NatLabRockies/scikit-sundae/issues). We also manage this solver package, but distribute it separately since it is not developed in pure Python.
30
+
31
+ For those interested in setting up a developer and/or editable version of this software, please see the directions available in the "Development" section of our [documentation](https://batmods-lite.readthedocs.io/en/latest/development).
32
+
33
+ ## Get Started
34
+ The API is organized around three main classes that allow you to construct simulations, define experiments, and interact with solutions. Two basic examples are given below. These demonstrate a 2C discharge for both the single particle model (SPM) and pseudo-2D (P2D) model. Note that the experiment class interfaces with all simulations. The simulations and their respective solutions, however, will depend on the model subpackage they are loaded from. For more detailed examples, check out the [documentation](https://batmods-lite.readthedocs.io) on Read the Docs. Note that while the full name of the package is `batmods-lite`, the installed module is imported using `bmlite`.
35
+
36
+ ```python
37
+ # Single particle model example
38
+ import bmlite as bm
39
+
40
+ sim = bm.SPM.Simulation()
41
+
42
+ expr = bm.Experiment()
43
+ expr.add_step('current_C', 2., (1350., 10.))
44
+
45
+ soln = sim.run(expr)
46
+ soln.simple_plot('time_s', 'voltage_V')
47
+ ```
48
+
49
+ ```python
50
+ # Pseudo-2D model example
51
+ import bmlite as bm
52
+
53
+ sim = bm.P2D.Simulation()
54
+
55
+ expr = bm.Experiment()
56
+ expr.add_step('current_C', 2., (1350., 10.))
57
+
58
+ soln = sim.run(expr)
59
+ soln.simple_plot('time_s', 'voltage_V')
60
+ ```
61
+
62
+ **Notes:**
63
+ * If you are new to Python, check out [Spyder IDE](https://www.spyder-ide.org/). Spyder is a powerful interactive development environment (IDE) that can make programming in Python more approachable to new users.
64
+ * Another friendly option for getting started in Python is to use [Jupyter Notebooks](https://jupyter.org/). We write our examples in Jupyter Notebooks since they support both markdown blocks for explanations and executable code blocks.
65
+ * Python, Spyder, and Jupyter Notebooks can be setup using [Anaconda](https://www.anaconda.com/download/success). Anaconda provides a convenient way for new users to get started with Python due to its friendly graphical installer and environment manager.
66
+
67
+ ## Citing this Work
68
+ This work was authored by researchers at the National Laboratory of the Rockies (NLR). If you use this package in your work, please include the following citation:
69
+
70
+ > Randall, Corey R. "BATMODS-lite: Packaged battery models and material properties [SWR-25-108]." Computer software, Jun. 2025. url: [github.com/NatLabRockies/batmods-lite](https://github.com/NatLabRockies/batmods-lite). doi: [10.11578/dc.20260114.1](https://doi.org./10.11578/dc.20260114.1).
71
+
72
+ For convenience, we also provide the following for your BibTex:
73
+
74
+ ```
75
+ @misc{randall2025bmlite,
76
+ author = {Randall, Corey R.},
77
+ title = {{BATMODS-lite: Packaged battery models and material properties [SWR-25-108]}},
78
+ url = {github.com/NatLabRockies/batmods-lite},
79
+ month = {Jun.},
80
+ year = {2025},
81
+ doi = {10.11578/dc.20260114.1},
82
+ }
83
+ ```
84
+
85
+ ## Contributing
86
+ If you'd like to contribute to this package, please look through the existing [issues](https://github.com/NatLabRockies/batmods-lite/issues). If the bug you've caught or the feature you'd like to add isn't already being worked on, please submit a new issue before getting started.
87
+
88
+ <!-- You should also read through the [developer guidelines](https://batmods-lite.readthedocs.io/latest/development). Need to get on readthedocs first... -->
89
+
90
+ ## Disclaimer
91
+ This work was authored by the National Laboratory of the Rockies (NLR), operated by Alliance for Energy Innovation, LLC, for the U.S. Department of Energy (DOE). The views expressed in the repository do not necessarily represent the views of the DOE or the U.S. Government.
@@ -0,0 +1,108 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "batmods-lite"
7
+ readme = "README.md"
8
+ dynamic = ["version"]
9
+ description = "Packaged battery models and material properties."
10
+ keywords = ["battery", "models", "lithium", "NMC", "LFP", "SPM", "P2D"]
11
+ requires-python = ">=3.10,<3.15"
12
+ license = "BSD-3-Clause"
13
+ license-files = ["LICENSE"]
14
+ authors = [
15
+ { name = "Corey R. Randall" },
16
+ { email = "corey.r.randall@gmail.com" },
17
+ ]
18
+ maintainers = [
19
+ { name = "Corey R. Randall" },
20
+ { email = "corey.r.randall@gmail.com" },
21
+ ]
22
+ classifiers = [
23
+ "Development Status :: 4 - Beta",
24
+ "Intended Audience :: Science/Research",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.10",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Programming Language :: Python :: 3.14",
31
+ ]
32
+ dependencies = [
33
+ "tqdm",
34
+ "numpy",
35
+ "scipy",
36
+ "pandas",
37
+ "openpyxl",
38
+ "matplotlib",
39
+ "ruamel.yaml",
40
+ "scikit-sundae>=1.1.3",
41
+ ]
42
+
43
+ [tool.setuptools.dynamic]
44
+ version = { attr = "bmlite.__version__" }
45
+
46
+ [tool.setuptools.packages.find]
47
+ where = ["src"]
48
+
49
+ [tool.setuptools.package-data]
50
+ "*" = ["*.yaml", "*.csv"]
51
+
52
+ [tool.ruff]
53
+ line-length = 80
54
+ exclude = ["build", "docs", "images", "reports", "references"]
55
+
56
+ [tool.ruff.lint]
57
+ preview = true
58
+ select = [
59
+ "E", # All pycodestyle errors
60
+ "W", # All pycodestyle warnings
61
+ "F", # All pyflakes errors
62
+ "B", # All flake8-bugbear checks
63
+ "D", # All pydocstyle checks
64
+ ]
65
+ extend-select = [
66
+ "E302", "E305", # Expected blank lines (requires preview=true, above)
67
+ ]
68
+ ignore = [
69
+ "B007", "B009", "B010", "B028", "B905",
70
+ "D1", "D203", "D205", "D212", "D400", "D401", "D415",
71
+ "E201", "E202", "E226", "E241", "E731",
72
+ ]
73
+
74
+ [tool.ruff.lint.pydocstyle]
75
+ convention = "numpy"
76
+
77
+ [tool.ruff.lint.per-file-ignores]
78
+ "tests/**/*" = ["D"]
79
+
80
+ [project.optional-dependencies]
81
+ docs = [
82
+ "sphinx",
83
+ "myst-nb",
84
+ "sphinx-design",
85
+ "sphinx-autoapi",
86
+ # "sphinx-favicon",
87
+ "sphinx-copybutton",
88
+ "pydata-sphinx-theme",
89
+ ]
90
+ tests = [
91
+ "pytest",
92
+ "pytest-cov",
93
+ "pytest-html",
94
+ "pytest-xdist",
95
+ ]
96
+ dev = [
97
+ "nox",
98
+ "ruff",
99
+ "codespell",
100
+ "batmods-lite[docs,tests]",
101
+ ]
102
+
103
+
104
+ [project.urls]
105
+ Homepage = "https://github.com/NatLabRockies/batmods-lite"
106
+ Documentation = "https://batmods-lite.readthedocs.io/"
107
+ Repository = "https://github.com/NatLabRockies/batmods-lite"
108
+ Issues = "https://github.com/NatLabRockies/batmods-lite/issues"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,143 @@
1
+ Metadata-Version: 2.4
2
+ Name: batmods-lite
3
+ Version: 0.0.2
4
+ Summary: Packaged battery models and material properties.
5
+ Author: Corey R. Randall
6
+ Author-email: corey.r.randall@gmail.com
7
+ Maintainer: Corey R. Randall
8
+ Maintainer-email: corey.r.randall@gmail.com
9
+ License-Expression: BSD-3-Clause
10
+ Project-URL: Homepage, https://github.com/NatLabRockies/batmods-lite
11
+ Project-URL: Documentation, https://batmods-lite.readthedocs.io/
12
+ Project-URL: Repository, https://github.com/NatLabRockies/batmods-lite
13
+ Project-URL: Issues, https://github.com/NatLabRockies/batmods-lite/issues
14
+ Keywords: battery,models,lithium,NMC,LFP,SPM,P2D
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Requires-Python: <3.15,>=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: tqdm
27
+ Requires-Dist: numpy
28
+ Requires-Dist: scipy
29
+ Requires-Dist: pandas
30
+ Requires-Dist: openpyxl
31
+ Requires-Dist: matplotlib
32
+ Requires-Dist: ruamel.yaml
33
+ Requires-Dist: scikit-sundae>=1.1.3
34
+ Provides-Extra: docs
35
+ Requires-Dist: sphinx; extra == "docs"
36
+ Requires-Dist: myst-nb; extra == "docs"
37
+ Requires-Dist: sphinx-design; extra == "docs"
38
+ Requires-Dist: sphinx-autoapi; extra == "docs"
39
+ Requires-Dist: sphinx-copybutton; extra == "docs"
40
+ Requires-Dist: pydata-sphinx-theme; extra == "docs"
41
+ Provides-Extra: tests
42
+ Requires-Dist: pytest; extra == "tests"
43
+ Requires-Dist: pytest-cov; extra == "tests"
44
+ Requires-Dist: pytest-html; extra == "tests"
45
+ Requires-Dist: pytest-xdist; extra == "tests"
46
+ Provides-Extra: dev
47
+ Requires-Dist: nox; extra == "dev"
48
+ Requires-Dist: ruff; extra == "dev"
49
+ Requires-Dist: codespell; extra == "dev"
50
+ Requires-Dist: batmods-lite[docs,tests]; extra == "dev"
51
+ Dynamic: license-file
52
+
53
+ <!-- <img alt='Logo' style='width: 75%; min-width: 250px; max-width: 500px;'
54
+ src='https://github.com/NatLabRockies/batmods-lite/blob/main/images/dark.png?raw=true#gh-dark-mode-only'/>
55
+ <img alt='Logo' style='width: 75%; min-width: 250px; max-width: 500px;'
56
+ src='https://github.com/NatLabRockies/batmods-lite/blob/main/images/light.png?raw=true#gh-light-mode-only'/> -->
57
+
58
+ # BATMODS-lite
59
+
60
+ [![ci](https://github.com/NatLabRockies/batmods-lite/actions/workflows/ci.yml/badge.svg)](https://github.com/NatLabRockies/batmods-lite/actions/workflows/ci.yml) &nbsp;
61
+ [![license](https://img.shields.io/badge/license-BSD--3-blue.svg)](https://github.com/NatLabRockies/batmods-lite/blob/main/LICENSE) &nbsp;
62
+ [![codecov](https://codecov.io/gh/NatLabRockies/batmods-lite/graph/badge.svg?token=MPuSOeIurf)](https://codecov.io/gh/NatLabRockies/batmods-lite) &nbsp;
63
+ [![pypi](https://img.shields.io/pypi/v/batmods-lite)](https://pypi.org/project/batmods-lite) &nbsp;
64
+ <!-- [![downloads](https://static.pepy.tech/personalized-badge/batmods-lite?period=total&units=INTERNATIONAL_SYSTEM&left_color=GREY&right_color=BRIGHTGREEN&left_text=pypi|downloads)](https://pepy.tech/projects/batmods-lite) -->
65
+
66
+ ## Summary
67
+ Battery Analysis and Training Models for Optimization and Design Studies (BATMODS) is a Python package with an API for pre-built battery models. The original purpose of the package was to quickly generate synthetic data for machine learning models to train with. However, the models are generally useful for any battery simulations or analysis. `BATMODS-lite` includes the following:
68
+
69
+ 1) A library and API for pre-built battery models
70
+ 2) Kinetic/transport properties for common battery materials
71
+
72
+ Note that the package focuses on phsics-based models like the single-particle (SPM) and pseudo-2D (P2D) model. If you enjoy the interface but are looking to run equivalent circuit models (ECMs), you should check out [thevenin](https://github.com/NatLabRockies/thevenin), which is distributed separately, but is developed and maintained by the same team. Consequently, the interface to `thevenin` models is intentionally similar, allowing for a smooth transition between physics-based and ECM approaches.
73
+
74
+ ## Installation
75
+ `BATMODS-lite` can be installed from [PyPI](https://pypi.org/project/batmods-lite) using the following command:
76
+
77
+ ```
78
+ pip install batmods-lite
79
+ ```
80
+
81
+ If you run into issues with installation due to the [scikit-sundae](https://github.com/NatLabRockies/scikit-sundae) dependency, please submit an issue [here](https://github.com/NatLabRockies/scikit-sundae/issues). We also manage this solver package, but distribute it separately since it is not developed in pure Python.
82
+
83
+ For those interested in setting up a developer and/or editable version of this software, please see the directions available in the "Development" section of our [documentation](https://batmods-lite.readthedocs.io/en/latest/development).
84
+
85
+ ## Get Started
86
+ The API is organized around three main classes that allow you to construct simulations, define experiments, and interact with solutions. Two basic examples are given below. These demonstrate a 2C discharge for both the single particle model (SPM) and pseudo-2D (P2D) model. Note that the experiment class interfaces with all simulations. The simulations and their respective solutions, however, will depend on the model subpackage they are loaded from. For more detailed examples, check out the [documentation](https://batmods-lite.readthedocs.io) on Read the Docs. Note that while the full name of the package is `batmods-lite`, the installed module is imported using `bmlite`.
87
+
88
+ ```python
89
+ # Single particle model example
90
+ import bmlite as bm
91
+
92
+ sim = bm.SPM.Simulation()
93
+
94
+ expr = bm.Experiment()
95
+ expr.add_step('current_C', 2., (1350., 10.))
96
+
97
+ soln = sim.run(expr)
98
+ soln.simple_plot('time_s', 'voltage_V')
99
+ ```
100
+
101
+ ```python
102
+ # Pseudo-2D model example
103
+ import bmlite as bm
104
+
105
+ sim = bm.P2D.Simulation()
106
+
107
+ expr = bm.Experiment()
108
+ expr.add_step('current_C', 2., (1350., 10.))
109
+
110
+ soln = sim.run(expr)
111
+ soln.simple_plot('time_s', 'voltage_V')
112
+ ```
113
+
114
+ **Notes:**
115
+ * If you are new to Python, check out [Spyder IDE](https://www.spyder-ide.org/). Spyder is a powerful interactive development environment (IDE) that can make programming in Python more approachable to new users.
116
+ * Another friendly option for getting started in Python is to use [Jupyter Notebooks](https://jupyter.org/). We write our examples in Jupyter Notebooks since they support both markdown blocks for explanations and executable code blocks.
117
+ * Python, Spyder, and Jupyter Notebooks can be setup using [Anaconda](https://www.anaconda.com/download/success). Anaconda provides a convenient way for new users to get started with Python due to its friendly graphical installer and environment manager.
118
+
119
+ ## Citing this Work
120
+ This work was authored by researchers at the National Laboratory of the Rockies (NLR). If you use this package in your work, please include the following citation:
121
+
122
+ > Randall, Corey R. "BATMODS-lite: Packaged battery models and material properties [SWR-25-108]." Computer software, Jun. 2025. url: [github.com/NatLabRockies/batmods-lite](https://github.com/NatLabRockies/batmods-lite). doi: [10.11578/dc.20260114.1](https://doi.org./10.11578/dc.20260114.1).
123
+
124
+ For convenience, we also provide the following for your BibTex:
125
+
126
+ ```
127
+ @misc{randall2025bmlite,
128
+ author = {Randall, Corey R.},
129
+ title = {{BATMODS-lite: Packaged battery models and material properties [SWR-25-108]}},
130
+ url = {github.com/NatLabRockies/batmods-lite},
131
+ month = {Jun.},
132
+ year = {2025},
133
+ doi = {10.11578/dc.20260114.1},
134
+ }
135
+ ```
136
+
137
+ ## Contributing
138
+ If you'd like to contribute to this package, please look through the existing [issues](https://github.com/NatLabRockies/batmods-lite/issues). If the bug you've caught or the feature you'd like to add isn't already being worked on, please submit a new issue before getting started.
139
+
140
+ <!-- You should also read through the [developer guidelines](https://batmods-lite.readthedocs.io/latest/development). Need to get on readthedocs first... -->
141
+
142
+ ## Disclaimer
143
+ This work was authored by the National Laboratory of the Rockies (NLR), operated by Alliance for Energy Innovation, LLC, for the U.S. Department of Energy (DOE). The views expressed in the repository do not necessarily represent the views of the DOE or the U.S. Government.
@@ -0,0 +1,51 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ src/batmods_lite.egg-info/PKG-INFO
6
+ src/batmods_lite.egg-info/SOURCES.txt
7
+ src/batmods_lite.egg-info/dependency_links.txt
8
+ src/batmods_lite.egg-info/requires.txt
9
+ src/batmods_lite.egg-info/top_level.txt
10
+ src/bmlite/__init__.py
11
+ src/bmlite/_utils.py
12
+ src/bmlite/mathutils.py
13
+ src/bmlite/mesh.py
14
+ src/bmlite/P2D/__init__.py
15
+ src/bmlite/P2D/_simulation.py
16
+ src/bmlite/P2D/_solutions.py
17
+ src/bmlite/P2D/dae.py
18
+ src/bmlite/P2D/domains.py
19
+ src/bmlite/P2D/postutils.py
20
+ src/bmlite/P2D/submodels.py
21
+ src/bmlite/P2D/templates/graphiteSiOx_nmc811.yaml
22
+ src/bmlite/P2D/templates/graphite_lfp.yaml
23
+ src/bmlite/P2D/templates/graphite_nmc532.yaml
24
+ src/bmlite/SPM/__init__.py
25
+ src/bmlite/SPM/_simulation.py
26
+ src/bmlite/SPM/_solutions.py
27
+ src/bmlite/SPM/dae.py
28
+ src/bmlite/SPM/domains.py
29
+ src/bmlite/SPM/postutils.py
30
+ src/bmlite/SPM/submodels.py
31
+ src/bmlite/SPM/templates/graphiteSiOx_nmc811.yaml
32
+ src/bmlite/SPM/templates/graphite_lfp.yaml
33
+ src/bmlite/SPM/templates/graphite_nmc532.yaml
34
+ src/bmlite/_core/__init__.py
35
+ src/bmlite/_core/_constants.py
36
+ src/bmlite/_core/_experiment.py
37
+ src/bmlite/_core/_idasolver.py
38
+ src/bmlite/_core/_templates.py
39
+ src/bmlite/materials/__init__.py
40
+ src/bmlite/materials/_gen2_electrolyte.py
41
+ src/bmlite/materials/_graphite.py
42
+ src/bmlite/materials/_graphite_SiOx.py
43
+ src/bmlite/materials/_lfp.py
44
+ src/bmlite/materials/_nmc_532.py
45
+ src/bmlite/materials/_nmc_811.py
46
+ src/bmlite/materials/data/graphite_ocv.csv
47
+ src/bmlite/materials/data/graphite_ocv_extrap.csv
48
+ src/bmlite/materials/data/lfp_ocv.csv
49
+ src/bmlite/materials/data/nmc532_ocv.csv
50
+ src/bmlite/materials/data/nmc532_ocv_extrap.csv
51
+ src/bmlite/plotutils/__init__.py
@@ -0,0 +1,28 @@
1
+ tqdm
2
+ numpy
3
+ scipy
4
+ pandas
5
+ openpyxl
6
+ matplotlib
7
+ ruamel.yaml
8
+ scikit-sundae>=1.1.3
9
+
10
+ [dev]
11
+ nox
12
+ ruff
13
+ codespell
14
+ batmods-lite[docs,tests]
15
+
16
+ [docs]
17
+ sphinx
18
+ myst-nb
19
+ sphinx-design
20
+ sphinx-autoapi
21
+ sphinx-copybutton
22
+ pydata-sphinx-theme
23
+
24
+ [tests]
25
+ pytest
26
+ pytest-cov
27
+ pytest-html
28
+ pytest-xdist
@@ -0,0 +1,25 @@
1
+ """
2
+ A packaged pseudo-2D (P2D) model. Build a model using the `Simulation` class,
3
+ and run an experiment using either the `run()` or `run_step()` methods. These
4
+ methods return `Solution` class instances with post processing, plotting, and
5
+ saving methods.
6
+
7
+ """
8
+
9
+ from ._simulation import Simulation
10
+ from ._solutions import StepSolution, CycleSolution
11
+
12
+ from . import dae
13
+ from . import domains
14
+ from . import postutils
15
+ from . import submodels
16
+
17
+ __all__ = [
18
+ 'Simulation',
19
+ 'StepSolution',
20
+ 'CycleSolution',
21
+ 'dae',
22
+ 'domains',
23
+ 'postutils',
24
+ 'submodels',
25
+ ]