Test generator for battery cyclers
Project description
BM Generator 3000
Test generator for battery cyclers.
Supported formats: Basytec, Neware, Digatron, JSON-LD.
Documentation: https://digibatt.github.io/bmgen
Examples: examples
Setup
The Python package is available on PyPI and can be installed using pip:
pip install bm-generator
The web version of the program can be started using the command:
bmgen-server
Installation from sources
The required dependencies and the package itself can also be installed from the sources using pip:
pip install -e .[dev]
A working installation of Python >= 3.10 and pip is required. The web version also requires npm. To build the modules for the web version and the documentation, the provided build script can be used:
./build.sh
Documentation
The documentation is built using the script
./build_docs.sh
Examples
This is a simple example that shows the basic structure of a program:
# import required functions and channel variables
from bmgen.function import *
from bmgen.channel import *
# set data recording interval
# registration format is only applied to BM programs
register(time=seconds(1), format=["my_custom_reg"])
# set safety limits
limit(V > 4.2, error(1))
limit(V < 2.5, error(1))
limit(I > 5, error(1))
limit(I < -5, error(1))
# specify test steps
charge(current=2.0, voltage=4.2, limits=[I < 0.2])
pause(hours=1)
discharge(current=1.5, limits=[V < 3.0])
To see the test programs that are generated, expand the sections below.
Battery Manager
Command for this example: bmgen --target bm --format table examples/simple_program.py
| Step | Label | Operator | Value | Limit | Action | Registration |
|---|---|---|---|---|---|---|
| 1 | SET | my_custom_reg 1 s | ||||
| 2 | SET | > 4.2 V < 2.5 V > 5 A < -5 A | ERR 1 ERR 1 ERR 1 ERR 1 | |||
| 3 | CHA | 2.0 A 4.2 V | < 0.2 A | |||
| 4 | PAU | 90 min | ||||
| 5 | DCH | 1.5 A | < 3.0 V | |||
| 6 | STO |
Neware
Command for this example: bmgen --target neware --format table examples/simple_program.py
| Step Index | Step Name | Step Time (hh:mm:ss.ms) | Voltage (V) | Current (A) | Cutoff voltage (V) | Cutoff current (A) | Capacity (Ah) | Others |
|---|---|---|---|---|---|---|---|---|
| 1 | CCCV Chg | 4.2 | 2.0 | 0.2 | ||||
| 2 | Rest | 1:30:00.000 | ||||||
| 3 | CC DChg | 1.5 | 3.0 | |||||
| 4 | End |
Basytec
Command for this example: bmgen --target basytec --format table examples/simple_program.py
| Level | Label | Command | Parameter | Termination | Action | Registration | Comment | |
|---|---|---|---|---|---|---|---|---|
| 1 | Start | U>4.2V U<2.5V I>5A I<-5A | ||||||
| 2 | Charge | I=2.0A U=4.2V | I<0.2A | t=1s | ||||
| 3 | Pause | t>90min | t=1s | |||||
| 4 | Discharge | I=1.5A | U<3.0V | t=1s | ||||
| 5 | STOP | Stop |
Web Interface
The easiest way to get started is using the web version by running the command:
bmgen-server
The web interface can be accessed at http://localhost:5000
CLI
The program can also be used as a command line tool:
bmgen
The only required argument is the filename of the Python program to be translated. A dash ( - ) can be used to read from standard input.
The following options are supported:
-t, --target
Set the target language. Available values are bm, neware, and basytec. The default value is bm.
-f, --format
Set the target format. The supported formats depend on the target:
BM:
- text (default): Plain text file that can be pasted into the Battery Manager
- table: HTML table resembling the Battery Manager interface for test programs
Neware:
- xml (default): XML file that can be opened in the Neware client
- table: HTML table resembling the Neware interface for test programs
Basytec:
- text (default): Plain text PLN file that can be opened in the Basytec program
- table: HTML table resembling the Basytec interface for test programs
-o, --out
Name of the output file. If this option is not provided, the output is written to the terminal.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bm_generator-0.29.13.tar.gz.
File metadata
- Download URL: bm_generator-0.29.13.tar.gz
- Upload date:
- Size: 53.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
366f26a6b404e8a33d0145ca86b7c3d407720daa0a01e04fd6f192019fa963e5
|
|
| MD5 |
0b81e608b478ffca2f521873795d1e92
|
|
| BLAKE2b-256 |
5795d308504dc3477acddd4c55cca1731c6f21f64d2b7e389dc1ebf6a8bee4bc
|
Provenance
The following attestation bundles were made for bm_generator-0.29.13.tar.gz:
Publisher:
publish-to-pypi.yml on DigiBatt/bmgen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bm_generator-0.29.13.tar.gz -
Subject digest:
366f26a6b404e8a33d0145ca86b7c3d407720daa0a01e04fd6f192019fa963e5 - Sigstore transparency entry: 1691285460
- Sigstore integration time:
-
Permalink:
DigiBatt/bmgen@47f2ebd8936c8961cc8fe3a99d97d5dc2da2acb7 -
Branch / Tag:
refs/tags/v0.29.13 - Owner: https://github.com/DigiBatt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@47f2ebd8936c8961cc8fe3a99d97d5dc2da2acb7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bm_generator-0.29.13-py3-none-any.whl.
File metadata
- Download URL: bm_generator-0.29.13-py3-none-any.whl
- Upload date:
- Size: 86.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e8738b4681c20c43879af02c48f12658f153d0acc1fd092be5ed2d192d2f384
|
|
| MD5 |
aeb286e7307d242c0be2259370087303
|
|
| BLAKE2b-256 |
514477741c630611a82ae0f2dc6b96852781a9c3eb22e7373c05c1508ed8439d
|
Provenance
The following attestation bundles were made for bm_generator-0.29.13-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on DigiBatt/bmgen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bm_generator-0.29.13-py3-none-any.whl -
Subject digest:
4e8738b4681c20c43879af02c48f12658f153d0acc1fd092be5ed2d192d2f384 - Sigstore transparency entry: 1691285499
- Sigstore integration time:
-
Permalink:
DigiBatt/bmgen@47f2ebd8936c8961cc8fe3a99d97d5dc2da2acb7 -
Branch / Tag:
refs/tags/v0.29.13 - Owner: https://github.com/DigiBatt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@47f2ebd8936c8961cc8fe3a99d97d5dc2da2acb7 -
Trigger Event:
release
-
Statement type: