batmods-lite 0.0.2rc0__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.2rc0/LICENSE +28 -0
  2. batmods_lite-0.0.2rc0/MANIFEST.in +1 -0
  3. batmods_lite-0.0.2rc0/PKG-INFO +144 -0
  4. batmods_lite-0.0.2rc0/README.md +92 -0
  5. batmods_lite-0.0.2rc0/pyproject.toml +108 -0
  6. batmods_lite-0.0.2rc0/setup.cfg +4 -0
  7. batmods_lite-0.0.2rc0/src/batmods_lite.egg-info/PKG-INFO +144 -0
  8. batmods_lite-0.0.2rc0/src/batmods_lite.egg-info/SOURCES.txt +51 -0
  9. batmods_lite-0.0.2rc0/src/batmods_lite.egg-info/dependency_links.txt +1 -0
  10. batmods_lite-0.0.2rc0/src/batmods_lite.egg-info/requires.txt +28 -0
  11. batmods_lite-0.0.2rc0/src/batmods_lite.egg-info/top_level.txt +1 -0
  12. batmods_lite-0.0.2rc0/src/bmlite/P2D/__init__.py +25 -0
  13. batmods_lite-0.0.2rc0/src/bmlite/P2D/_simulation.py +444 -0
  14. batmods_lite-0.0.2rc0/src/bmlite/P2D/_solutions.py +647 -0
  15. batmods_lite-0.0.2rc0/src/bmlite/P2D/dae.py +351 -0
  16. batmods_lite-0.0.2rc0/src/bmlite/P2D/domains.py +659 -0
  17. batmods_lite-0.0.2rc0/src/bmlite/P2D/postutils.py +496 -0
  18. batmods_lite-0.0.2rc0/src/bmlite/P2D/submodels.py +140 -0
  19. batmods_lite-0.0.2rc0/src/bmlite/P2D/templates/graphiteSiOx_nmc811.yaml +54 -0
  20. batmods_lite-0.0.2rc0/src/bmlite/P2D/templates/graphite_lfp.yaml +59 -0
  21. batmods_lite-0.0.2rc0/src/bmlite/P2D/templates/graphite_nmc532.yaml +54 -0
  22. batmods_lite-0.0.2rc0/src/bmlite/SPM/__init__.py +25 -0
  23. batmods_lite-0.0.2rc0/src/bmlite/SPM/_simulation.py +437 -0
  24. batmods_lite-0.0.2rc0/src/bmlite/SPM/_solutions.py +552 -0
  25. batmods_lite-0.0.2rc0/src/bmlite/SPM/dae.py +194 -0
  26. batmods_lite-0.0.2rc0/src/bmlite/SPM/domains.py +458 -0
  27. batmods_lite-0.0.2rc0/src/bmlite/SPM/postutils.py +279 -0
  28. batmods_lite-0.0.2rc0/src/bmlite/SPM/submodels.py +140 -0
  29. batmods_lite-0.0.2rc0/src/bmlite/SPM/templates/graphiteSiOx_nmc811.yaml +37 -0
  30. batmods_lite-0.0.2rc0/src/bmlite/SPM/templates/graphite_lfp.yaml +42 -0
  31. batmods_lite-0.0.2rc0/src/bmlite/SPM/templates/graphite_nmc532.yaml +37 -0
  32. batmods_lite-0.0.2rc0/src/bmlite/__init__.py +55 -0
  33. batmods_lite-0.0.2rc0/src/bmlite/_core/__init__.py +18 -0
  34. batmods_lite-0.0.2rc0/src/bmlite/_core/_constants.py +17 -0
  35. batmods_lite-0.0.2rc0/src/bmlite/_core/_experiment.py +291 -0
  36. batmods_lite-0.0.2rc0/src/bmlite/_core/_idasolver.py +116 -0
  37. batmods_lite-0.0.2rc0/src/bmlite/_core/_templates.py +55 -0
  38. batmods_lite-0.0.2rc0/src/bmlite/_utils.py +193 -0
  39. batmods_lite-0.0.2rc0/src/bmlite/materials/__init__.py +29 -0
  40. batmods_lite-0.0.2rc0/src/bmlite/materials/_gen2_electrolyte.py +136 -0
  41. batmods_lite-0.0.2rc0/src/bmlite/materials/_graphite.py +329 -0
  42. batmods_lite-0.0.2rc0/src/bmlite/materials/_graphite_SiOx.py +274 -0
  43. batmods_lite-0.0.2rc0/src/bmlite/materials/_lfp.py +152 -0
  44. batmods_lite-0.0.2rc0/src/bmlite/materials/_nmc_532.py +301 -0
  45. batmods_lite-0.0.2rc0/src/bmlite/materials/_nmc_811.py +272 -0
  46. batmods_lite-0.0.2rc0/src/bmlite/materials/data/graphite_ocv.csv +257 -0
  47. batmods_lite-0.0.2rc0/src/bmlite/materials/data/graphite_ocv_extrap.csv +258 -0
  48. batmods_lite-0.0.2rc0/src/bmlite/materials/data/lfp_ocv.csv +255 -0
  49. batmods_lite-0.0.2rc0/src/bmlite/materials/data/nmc532_ocv.csv +222 -0
  50. batmods_lite-0.0.2rc0/src/bmlite/materials/data/nmc532_ocv_extrap.csv +227 -0
  51. batmods_lite-0.0.2rc0/src/bmlite/mathutils.py +280 -0
  52. batmods_lite-0.0.2rc0/src/bmlite/mesh.py +200 -0
  53. batmods_lite-0.0.2rc0/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,144 @@
1
+ Metadata-Version: 2.4
2
+ Name: batmods-lite
3
+ Version: 0.0.2rc0
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
+ [![codecov](https://codecov.io/gh/NatLabRockies/batmods-lite/graph/badge.svg?token=MPuSOeIurf)](https://codecov.io/gh/NatLabRockies/batmods-lite) &nbsp;
62
+ [![license](https://img.shields.io/badge/license-BSD--3-blue.svg)](https://github.com/NatLabRockies/batmods-lite/blob/main/LICENSE) &nbsp;
63
+
64
+ ## Summary
65
+ 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:
66
+
67
+ 1) A library and API for pre-built battery models
68
+ 2) Kinetic/transport properties for common battery materials
69
+
70
+ 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.
71
+
72
+ ## Installation
73
+ `BATMODS-lite` is only available via GitHub. Please clone the repo or download the files. Also, make sure you have a Python installation with a version >=3.10. If you are new to Python, we recommend using [Anaconda](https://anaconda.com/download) to set up your installation.
74
+
75
+ Once the files are available on your machine, use your terminal to navigate into the folder and execute one of the following depending on your installation preference.
76
+
77
+ ```
78
+ pip install . (basic installation)
79
+ pip install -e .[dev] (editable installation with developer options)
80
+ ```
81
+
82
+ The editable installation is useful if you plan to make changes to your local package. It ensures that any changes are immediately available each time the package is imported, without needing to reinstall. The developer options will likely be helpful if you are modifying the package.
83
+
84
+ 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.
85
+
86
+ ## Get Started
87
+ 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 a more detailed tutorial, please check `docs/source/examples`. If you installed the editable version with developer options, you can also build the documentation locally using `nox -s docs`.
88
+
89
+ ```python
90
+ # Single particle model example
91
+ import bmlite as bm
92
+
93
+ sim = bm.SPM.Simulation()
94
+
95
+ expr = bm.Experiment()
96
+ expr.add_step('current_C', 2., (1350., 10.))
97
+
98
+ soln = sim.run(expr)
99
+ soln.simple_plot('time_s', 'voltage_V')
100
+ ```
101
+
102
+ ```python
103
+ # Pseudo-2D model example
104
+ import bmlite as bm
105
+
106
+ sim = bm.P2D.Simulation()
107
+
108
+ expr = bm.Experiment()
109
+ expr.add_step('current_C', 2., (1350., 10.))
110
+
111
+ soln = sim.run(expr)
112
+ soln.simple_plot('time_s', 'voltage_V')
113
+ ```
114
+
115
+ **Notes:**
116
+ * 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.
117
+ * 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.
118
+ * 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.
119
+
120
+ ## Citing this Work
121
+ 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:
122
+
123
+ > 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).
124
+
125
+ For convenience, we also provide the following for your BibTex:
126
+
127
+ ```
128
+ @misc{randall2025bmlite,
129
+ author = {Randall, Corey R.},
130
+ title = {{BATMODS-lite: Packaged battery models and material properties [SWR-25-108]}},
131
+ url = {github.com/NatLabRockies/batmods-lite},
132
+ month = {Jun.},
133
+ year = {2025},
134
+ doi = {10.11578/dc.20260114.1},
135
+ }
136
+ ```
137
+
138
+ ## Contributing
139
+ 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.
140
+
141
+ <!-- You should also read through the [developer guidelines](https://batmods-lite.readthedocs.io/latest/development). Need to get on readthedocs first... -->
142
+
143
+ ## Disclaimer
144
+ 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,92 @@
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
+ [![codecov](https://codecov.io/gh/NatLabRockies/batmods-lite/graph/badge.svg?token=MPuSOeIurf)](https://codecov.io/gh/NatLabRockies/batmods-lite) &nbsp;
10
+ [![license](https://img.shields.io/badge/license-BSD--3-blue.svg)](https://github.com/NatLabRockies/batmods-lite/blob/main/LICENSE) &nbsp;
11
+
12
+ ## Summary
13
+ 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:
14
+
15
+ 1) A library and API for pre-built battery models
16
+ 2) Kinetic/transport properties for common battery materials
17
+
18
+ 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.
19
+
20
+ ## Installation
21
+ `BATMODS-lite` is only available via GitHub. Please clone the repo or download the files. Also, make sure you have a Python installation with a version >=3.10. If you are new to Python, we recommend using [Anaconda](https://anaconda.com/download) to set up your installation.
22
+
23
+ Once the files are available on your machine, use your terminal to navigate into the folder and execute one of the following depending on your installation preference.
24
+
25
+ ```
26
+ pip install . (basic installation)
27
+ pip install -e .[dev] (editable installation with developer options)
28
+ ```
29
+
30
+ The editable installation is useful if you plan to make changes to your local package. It ensures that any changes are immediately available each time the package is imported, without needing to reinstall. The developer options will likely be helpful if you are modifying the package.
31
+
32
+ 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.
33
+
34
+ ## Get Started
35
+ 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 a more detailed tutorial, please check `docs/source/examples`. If you installed the editable version with developer options, you can also build the documentation locally using `nox -s docs`.
36
+
37
+ ```python
38
+ # Single particle model example
39
+ import bmlite as bm
40
+
41
+ sim = bm.SPM.Simulation()
42
+
43
+ expr = bm.Experiment()
44
+ expr.add_step('current_C', 2., (1350., 10.))
45
+
46
+ soln = sim.run(expr)
47
+ soln.simple_plot('time_s', 'voltage_V')
48
+ ```
49
+
50
+ ```python
51
+ # Pseudo-2D model example
52
+ import bmlite as bm
53
+
54
+ sim = bm.P2D.Simulation()
55
+
56
+ expr = bm.Experiment()
57
+ expr.add_step('current_C', 2., (1350., 10.))
58
+
59
+ soln = sim.run(expr)
60
+ soln.simple_plot('time_s', 'voltage_V')
61
+ ```
62
+
63
+ **Notes:**
64
+ * 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.
65
+ * 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.
66
+ * 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.
67
+
68
+ ## Citing this Work
69
+ 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:
70
+
71
+ > 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).
72
+
73
+ For convenience, we also provide the following for your BibTex:
74
+
75
+ ```
76
+ @misc{randall2025bmlite,
77
+ author = {Randall, Corey R.},
78
+ title = {{BATMODS-lite: Packaged battery models and material properties [SWR-25-108]}},
79
+ url = {github.com/NatLabRockies/batmods-lite},
80
+ month = {Jun.},
81
+ year = {2025},
82
+ doi = {10.11578/dc.20260114.1},
83
+ }
84
+ ```
85
+
86
+ ## Contributing
87
+ 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.
88
+
89
+ <!-- You should also read through the [developer guidelines](https://batmods-lite.readthedocs.io/latest/development). Need to get on readthedocs first... -->
90
+
91
+ ## Disclaimer
92
+ 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,144 @@
1
+ Metadata-Version: 2.4
2
+ Name: batmods-lite
3
+ Version: 0.0.2rc0
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
+ [![codecov](https://codecov.io/gh/NatLabRockies/batmods-lite/graph/badge.svg?token=MPuSOeIurf)](https://codecov.io/gh/NatLabRockies/batmods-lite) &nbsp;
62
+ [![license](https://img.shields.io/badge/license-BSD--3-blue.svg)](https://github.com/NatLabRockies/batmods-lite/blob/main/LICENSE) &nbsp;
63
+
64
+ ## Summary
65
+ 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:
66
+
67
+ 1) A library and API for pre-built battery models
68
+ 2) Kinetic/transport properties for common battery materials
69
+
70
+ 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.
71
+
72
+ ## Installation
73
+ `BATMODS-lite` is only available via GitHub. Please clone the repo or download the files. Also, make sure you have a Python installation with a version >=3.10. If you are new to Python, we recommend using [Anaconda](https://anaconda.com/download) to set up your installation.
74
+
75
+ Once the files are available on your machine, use your terminal to navigate into the folder and execute one of the following depending on your installation preference.
76
+
77
+ ```
78
+ pip install . (basic installation)
79
+ pip install -e .[dev] (editable installation with developer options)
80
+ ```
81
+
82
+ The editable installation is useful if you plan to make changes to your local package. It ensures that any changes are immediately available each time the package is imported, without needing to reinstall. The developer options will likely be helpful if you are modifying the package.
83
+
84
+ 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.
85
+
86
+ ## Get Started
87
+ 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 a more detailed tutorial, please check `docs/source/examples`. If you installed the editable version with developer options, you can also build the documentation locally using `nox -s docs`.
88
+
89
+ ```python
90
+ # Single particle model example
91
+ import bmlite as bm
92
+
93
+ sim = bm.SPM.Simulation()
94
+
95
+ expr = bm.Experiment()
96
+ expr.add_step('current_C', 2., (1350., 10.))
97
+
98
+ soln = sim.run(expr)
99
+ soln.simple_plot('time_s', 'voltage_V')
100
+ ```
101
+
102
+ ```python
103
+ # Pseudo-2D model example
104
+ import bmlite as bm
105
+
106
+ sim = bm.P2D.Simulation()
107
+
108
+ expr = bm.Experiment()
109
+ expr.add_step('current_C', 2., (1350., 10.))
110
+
111
+ soln = sim.run(expr)
112
+ soln.simple_plot('time_s', 'voltage_V')
113
+ ```
114
+
115
+ **Notes:**
116
+ * 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.
117
+ * 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.
118
+ * 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.
119
+
120
+ ## Citing this Work
121
+ 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:
122
+
123
+ > 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).
124
+
125
+ For convenience, we also provide the following for your BibTex:
126
+
127
+ ```
128
+ @misc{randall2025bmlite,
129
+ author = {Randall, Corey R.},
130
+ title = {{BATMODS-lite: Packaged battery models and material properties [SWR-25-108]}},
131
+ url = {github.com/NatLabRockies/batmods-lite},
132
+ month = {Jun.},
133
+ year = {2025},
134
+ doi = {10.11578/dc.20260114.1},
135
+ }
136
+ ```
137
+
138
+ ## Contributing
139
+ 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.
140
+
141
+ <!-- You should also read through the [developer guidelines](https://batmods-lite.readthedocs.io/latest/development). Need to get on readthedocs first... -->
142
+
143
+ ## Disclaimer
144
+ 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
+ ]