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.0

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.0
File Size Uploaded
pyflowbatt-0.2.0.tar.gz 38.3 kB Details

Built distribution (wheel)

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

Total release size: 80.2 kB

Release files / pyflowbatt-0.2.0.tar.gz

Download URL pyflowbatt-0.2.0.tar.gz
Size 38.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a9c0eb16b938f4592a378c612780f813a6ca476e9d929a4e241085c581e2086d
BLAKE2b-256 checksum
How to use checksums
3e5f6f1f805cceacab02a9dcecdb02d0b20f36632a6df35d86eef996dc163187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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.0-py3-none-any.whl

Download URL pyflowbatt-0.2.0-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f4781a10d59b902f9f4c237a85178566a194adc18186fe254fc9702bc9599b5
BLAKE2b-256 checksum
How to use checksums
45c29bd28f2e152aab3daf8357c63ebf85a8b6d9bd3017192733677baeec5fbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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