Skip to main content

🌊 PyFlowBatt

This Python package contains functions and a CLI for analysing data from the flow battery lab at Empa.

Installation

Use Python >3.10, and install with pip:

pip install git+https://github.com/empaeconversion/pyflowbatt.git

Usage

Use in a terminal (e.g. Command Prompt or PowerShell).

To analyse data and get a full summary and ro-crate, use pyflowbatt --folder="path/to/your/folder".

To zip everything at the end (e.g. to upload to Zenodo), use pyflowbatt --folder="path/to/your/folder" --zip.

You can also navigate to a folder e.g.

cd path/to/your/folder
pyflowbatt

PyFlowBatt will automatically scan for files like GCPL, EIS, LSV, CV, as well as BattInfo Converter .xlsx files, process the data, convert to battery data format, produce summary graphs and excel reports, create a BattInfo JSON-LD metadata file, and a top level ro-crate metadata file.

A full analysis can take a while. You can do a 'dry run' to check what files would be analysed:

pyflowbatt --dry
pyflowbatt --dry --folder="path/to/your/folder" --zip

This is useful for checking everything is in order before running a long analysis.

You can override some settings by adding a pyflowbatt.toml file to a sample folder, parent folder, or your home folder. Use pyflowbatt init to create a template file and see what can be modified.

Using in Python

You can also use the functions in Python, e.g.

# Use individual functions
from pyflowbatt import gcpl, lsv, cv
from pyflowbatt.read import read_to_bdf

df = read_to_bdf("path/to/my/gcpl-file")
df, cycle_df = gcpl.analyse(df)

cv_df = read_to_bdf("path/to/my/cv-file")
cv_df, cv_cycle_df, capacitance_mF = cv.analyse(cv_df)

lsv_df = read_to_bdf("path/to/my/lsv-file")
lsv_result_dict = lsv.analyse(lsv_df)

# Or run the full analysis on folders
from pyflowbatt.analysis import analyse_sample, analyse_all_samples
analyse_sample("path/to/sample/folder")
analyse_all_samples("path/to/parent/folder/of/many/samples")

For contributors

If you find bugs, or want new features, open an issue on the GitHub page.

If you want to directly contribute to the project, it is easiest to use the tool 'uv':

git clone https://github.com/empaeconversion/pyflowbatt.git

cd pyflowbatt

uv sync

Then open this folder in an editor like VSCode.

You should always create a new branch before making edits, main is only for tested, working code that everyone can use.

E.g. make and switch to a new branch with

git checkout -b new-feature

You have now branched off the main PyFlowBatt into your own branch called e.g. new-feature. Now you can do whatever you like and it won't affect the main branch.

When you have made and committed some changes that add a feature or fix a problem, and you want to put them into main, open a pull request on GitHub.

Metadata

Release files for pyflowbatt 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyflowbatt 0.2.1
File Size Uploaded
pyflowbatt-0.2.1.tar.gz 41.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyflowbatt 0.2.1
File Interpreter ABI Platform
pyflowbatt-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 86.9 kB

Release files / pyflowbatt-0.2.1.tar.gz

Download URL pyflowbatt-0.2.1.tar.gz
Size 41.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b1c1ba35248a7694ff4ef3e704d8d30b8424f3019d4ecfd1b7be123abcf6a512
BLAKE2b-256 checksum
How to use checksums
652809e9603a9d5295c98f06efec0a2b24b1a4e0bb6d2362225ac6c13a5c68a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyflowbatt-0.2.1-py3-none-any.whl

Download URL pyflowbatt-0.2.1-py3-none-any.whl
Size 45.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d44f6073a3a44d374e9ef71e2cf66cd688ca8d4504ca59f71aca33abd33fd346
BLAKE2b-256 checksum
How to use checksums
c6abd928f9dcf5cd1f3e85901f74c2d5964dbea75ef8a90849fdd1f97200d97d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page