aurora-biologic 0.2.1__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.
@@ -0,0 +1,75 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ tags:
7
+ - v[0-9]+.[0-9]+.[0-9]+*
8
+ pull_request:
9
+ branches: [ "main" ]
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ test:
16
+ name: Test with Pytest
17
+ runs-on: windows-latest
18
+ strategy:
19
+ matrix:
20
+ python-version:
21
+ - "3.10"
22
+ - "3.13"
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - name: Install uv and set the python version
27
+ uses: astral-sh/setup-uv@v5
28
+ with:
29
+ enable-cache: true
30
+ python-version: ${{ matrix.python-version }}
31
+
32
+ - name: Install
33
+ run: |
34
+ uv pip install ruff pytest pytest-cov
35
+ uv pip install -e .
36
+ - name: Lint with ruff
37
+ run: |
38
+ ruff check --select=F,E9,B
39
+
40
+ - name: Test with pytest
41
+ run: |
42
+ pytest --cov=aurora_biologic --cov-report=term
43
+
44
+ # Publish to PyPI if tagged and tests pass
45
+ publish:
46
+ name: Publish to PyPI
47
+ needs: test
48
+ if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'empaeconversion/aurora-biologic'
49
+ runs-on: windows-latest
50
+ permissions:
51
+ id-token: write
52
+ contents: write
53
+
54
+ steps:
55
+ - name: Checkout code
56
+ uses: actions/checkout@v4
57
+
58
+ - name: Set up Python
59
+ uses: actions/setup-python@v5
60
+ with:
61
+ python-version: '3.12'
62
+
63
+ - name: Install flit
64
+ run: pip install flit~=3.12
65
+
66
+ - name: Publish to PyPI
67
+ run: flit publish
68
+ env:
69
+ FLIT_USERNAME: __token__
70
+ FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
71
+
72
+ - name: Create GitHub release
73
+ uses: softprops/action-gh-release@v2
74
+ with:
75
+ generate_release_notes: true
@@ -0,0 +1,13 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ # UV lock file
13
+ uv.lock
@@ -0,0 +1,7 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.12.4
4
+ hooks:
5
+ - id: ruff-check
6
+ args: ["--fix", "--select=F,E9,B"]
7
+ - id: ruff-format
@@ -0,0 +1,162 @@
1
+ Metadata-Version: 2.4
2
+ Name: aurora-biologic
3
+ Version: 0.2.1
4
+ Summary: Python API for Biologic EC-lab potentiostats
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Dist: comtypes>=1.4.11
12
+ Requires-Dist: platformdirs>=4.3.8
13
+ Requires-Dist: pre-commit>=4.3.0
14
+ Requires-Dist: psutil>=7.0.0
15
+ Requires-Dist: typer>=0.16.0
16
+ Requires-Dist: bumpver>=2025.1131 ; extra == "dev"
17
+ Requires-Dist: pytest>=8.4.1 ; extra == "dev"
18
+ Requires-Dist: ruff>=0.12.3 ; extra == "dev"
19
+ Provides-Extra: dev
20
+
21
+ <p align="center">
22
+ <img src="https://github.com/user-attachments/assets/0caae30d-92cf-4964-b95d-c84d59041a78#gh-light-mode-only" width="500" align="center" alt="aurora-biologic logo">
23
+ <img src="https://github.com/user-attachments/assets/7a32e5f4-f2a7-4ef4-83b1-50e9e10ff4fb#gh-dark-mode-only" width="500" align="center" alt="aurora-biologic logo">
24
+ </p>
25
+
26
+ </br>
27
+
28
+ ## Overview
29
+ `aurora-biologic` provides a standalone Python API and command line interface (CLI) to control Biologic cyclers.
30
+
31
+ It is designed and tested on MPG2 cyclers using EC-lab 11.52 and 11.61.
32
+
33
+ ## Features
34
+ - CLI and Python API
35
+ - Connect to EC-lab cyclers
36
+ - Retrieve status of channels
37
+ - Load protocols onto channels
38
+ - Start and stop experiments
39
+
40
+ For parsing binary data from Biologic, we recommend [`yadg`](https://github.com/dgbowl/yadg).
41
+
42
+ ## Installation
43
+ Install on a Windows PC with EC-lab >11.52 installed.
44
+ > [!IMPORTANT]
45
+ > EC-lab must have OLE/COM activated
46
+
47
+ OLE/COM is a Windows interface for programs to expose their functionality to third-parties, which is supported by EC-lab.
48
+
49
+ Open a terminal as administrator, go to your folder containing `EClab.exe` and register the server:
50
+
51
+ `cmd`
52
+ ```cmd
53
+ cd "C:/Program files (x86)/EC-lab"
54
+ eclab \regserver
55
+ ```
56
+
57
+ `powershell`
58
+ ```powershell
59
+ cd "C:/Program files (x86)/EC-lab"
60
+ .\eclab \\regserver
61
+ ```
62
+
63
+ You can also deregister in the same way with `/unregserver`.
64
+
65
+ Next, install this package with
66
+ ```bash
67
+ pip install aurora-biologic
68
+ ```
69
+
70
+ To see commands, use
71
+ ```bash
72
+ biologic --help
73
+ ```
74
+
75
+ The first time you run the command line, a config file is generated at:
76
+
77
+ `C:\Users\<user>\AppData\Local\aurora-biologic\aurora-biologic\config.json`
78
+
79
+ which will look like:
80
+ ```json
81
+ {
82
+ "serial_to_name": {
83
+ "12345": "MPG2-1",
84
+ "12346": "MPG2-2"
85
+ },
86
+ "eclab_path": "C:/Program Files (x86)/EC-Lab/EClab.exe"
87
+ }
88
+ ```
89
+ Rename your devices according to their serial number, and make sure the EC-lab executable path is correct and the same as the executable registered in the first step.
90
+
91
+ ## CLI usage
92
+
93
+ Make sure EC-lab is running.
94
+
95
+ You can check what devices and channels were found with
96
+ ```bash
97
+ biologic pipelines
98
+ ```
99
+ The pipeline ID is made up of the `{device name}-{channel index}`, such as `MPG2-1-7`
100
+
101
+ These IDs are used for other functions, for example to see the status of that channel use
102
+ ```bash
103
+ biologic status MPG2-1-7
104
+ ```
105
+
106
+ >[!TIP]
107
+ >See all commands with `biologic --help`.
108
+ >
109
+ >See details of a command with `biologic [command] --help` e.g. `biologic status --help`.
110
+
111
+ ## API usage
112
+
113
+ Commands can also be run using Python.
114
+
115
+ Make sure EC-lab is running.
116
+
117
+ Then commands can be run using the BiologicAPI object
118
+ ```python
119
+ from aurora_biologic import BiologicAPI
120
+ with BiologicAPI() as bio:
121
+ bio.start(
122
+ "my_pipeline_id",
123
+ "path/to/my_experiment.mps",
124
+ "path/to/an/output.mpr",
125
+ )
126
+ ```
127
+
128
+ ## Using commands over SSH
129
+ >[!WARNING]
130
+ >OLE/COM requires an interactive session to function.
131
+ >
132
+ >Standard command line functions will not work in non-interactive session, such as normal SSH from a terminal.
133
+
134
+ To use the CLI over SSH you must start a listener daemon in an interactive terminal.
135
+
136
+ On the PC with EC-lab, start the listener with:
137
+ ```bash
138
+ biologic daemon
139
+ ```
140
+
141
+ Then from the SSH session use normal CLI commands with the `--ssh` option, e.g.
142
+ ```bash
143
+ biologic status --ssh
144
+ ```
145
+
146
+ Instead of trying to run OLE/COM commands directly in the non-interactive session, it will send commands to the daemon, which will execute and reply.
147
+
148
+ ## Contributors
149
+
150
+ - [Graham Kimbell](https://github.com/g-kimbell)
151
+
152
+ ## Acknowledgements
153
+
154
+ Special thanks to Julian Diener from Biologic for their advice and support.
155
+
156
+ This software was developed at the Laboratory of Materials for Energy Conversion at Empa, the Swiss Federal Laboratories for Materials Science and Technology, and supported by funding from the [IntelLiGent](https://heuintelligent.eu/) project from the European Union’s research and innovation program under grant agreement No. 101069765, and from the Swiss State Secretariat for Education, Research, and Innovation (SERI) under contract No. 22.001422.
157
+
158
+ <img src="https://github.com/user-attachments/assets/373d30b2-a7a4-4158-a3d8-f76e3a45a508#gh-light-mode-only" height="100" alt="IntelLiGent logo">
159
+ <img src="https://github.com/user-attachments/assets/9d003d4f-af2f-497a-8560-d228cc93177c#gh-dark-mode-only" height="100" alt="IntelLiGent logo">&nbsp;&nbsp;&nbsp;&nbsp;
160
+ <img src="https://github.com/user-attachments/assets/1d32a635-703b-432c-9d42-02e07d94e9a9" height="100" alt="EU flag">&nbsp;&nbsp;&nbsp;&nbsp;
161
+ <img src="https://github.com/user-attachments/assets/cd410b39-5989-47e5-b502-594d9a8f5ae1" height="100" alt="Swiss secretariat">
162
+
@@ -0,0 +1,141 @@
1
+ <p align="center">
2
+ <img src="https://github.com/user-attachments/assets/0caae30d-92cf-4964-b95d-c84d59041a78#gh-light-mode-only" width="500" align="center" alt="aurora-biologic logo">
3
+ <img src="https://github.com/user-attachments/assets/7a32e5f4-f2a7-4ef4-83b1-50e9e10ff4fb#gh-dark-mode-only" width="500" align="center" alt="aurora-biologic logo">
4
+ </p>
5
+
6
+ </br>
7
+
8
+ ## Overview
9
+ `aurora-biologic` provides a standalone Python API and command line interface (CLI) to control Biologic cyclers.
10
+
11
+ It is designed and tested on MPG2 cyclers using EC-lab 11.52 and 11.61.
12
+
13
+ ## Features
14
+ - CLI and Python API
15
+ - Connect to EC-lab cyclers
16
+ - Retrieve status of channels
17
+ - Load protocols onto channels
18
+ - Start and stop experiments
19
+
20
+ For parsing binary data from Biologic, we recommend [`yadg`](https://github.com/dgbowl/yadg).
21
+
22
+ ## Installation
23
+ Install on a Windows PC with EC-lab >11.52 installed.
24
+ > [!IMPORTANT]
25
+ > EC-lab must have OLE/COM activated
26
+
27
+ OLE/COM is a Windows interface for programs to expose their functionality to third-parties, which is supported by EC-lab.
28
+
29
+ Open a terminal as administrator, go to your folder containing `EClab.exe` and register the server:
30
+
31
+ `cmd`
32
+ ```cmd
33
+ cd "C:/Program files (x86)/EC-lab"
34
+ eclab \regserver
35
+ ```
36
+
37
+ `powershell`
38
+ ```powershell
39
+ cd "C:/Program files (x86)/EC-lab"
40
+ .\eclab \\regserver
41
+ ```
42
+
43
+ You can also deregister in the same way with `/unregserver`.
44
+
45
+ Next, install this package with
46
+ ```bash
47
+ pip install aurora-biologic
48
+ ```
49
+
50
+ To see commands, use
51
+ ```bash
52
+ biologic --help
53
+ ```
54
+
55
+ The first time you run the command line, a config file is generated at:
56
+
57
+ `C:\Users\<user>\AppData\Local\aurora-biologic\aurora-biologic\config.json`
58
+
59
+ which will look like:
60
+ ```json
61
+ {
62
+ "serial_to_name": {
63
+ "12345": "MPG2-1",
64
+ "12346": "MPG2-2"
65
+ },
66
+ "eclab_path": "C:/Program Files (x86)/EC-Lab/EClab.exe"
67
+ }
68
+ ```
69
+ Rename your devices according to their serial number, and make sure the EC-lab executable path is correct and the same as the executable registered in the first step.
70
+
71
+ ## CLI usage
72
+
73
+ Make sure EC-lab is running.
74
+
75
+ You can check what devices and channels were found with
76
+ ```bash
77
+ biologic pipelines
78
+ ```
79
+ The pipeline ID is made up of the `{device name}-{channel index}`, such as `MPG2-1-7`
80
+
81
+ These IDs are used for other functions, for example to see the status of that channel use
82
+ ```bash
83
+ biologic status MPG2-1-7
84
+ ```
85
+
86
+ >[!TIP]
87
+ >See all commands with `biologic --help`.
88
+ >
89
+ >See details of a command with `biologic [command] --help` e.g. `biologic status --help`.
90
+
91
+ ## API usage
92
+
93
+ Commands can also be run using Python.
94
+
95
+ Make sure EC-lab is running.
96
+
97
+ Then commands can be run using the BiologicAPI object
98
+ ```python
99
+ from aurora_biologic import BiologicAPI
100
+ with BiologicAPI() as bio:
101
+ bio.start(
102
+ "my_pipeline_id",
103
+ "path/to/my_experiment.mps",
104
+ "path/to/an/output.mpr",
105
+ )
106
+ ```
107
+
108
+ ## Using commands over SSH
109
+ >[!WARNING]
110
+ >OLE/COM requires an interactive session to function.
111
+ >
112
+ >Standard command line functions will not work in non-interactive session, such as normal SSH from a terminal.
113
+
114
+ To use the CLI over SSH you must start a listener daemon in an interactive terminal.
115
+
116
+ On the PC with EC-lab, start the listener with:
117
+ ```bash
118
+ biologic daemon
119
+ ```
120
+
121
+ Then from the SSH session use normal CLI commands with the `--ssh` option, e.g.
122
+ ```bash
123
+ biologic status --ssh
124
+ ```
125
+
126
+ Instead of trying to run OLE/COM commands directly in the non-interactive session, it will send commands to the daemon, which will execute and reply.
127
+
128
+ ## Contributors
129
+
130
+ - [Graham Kimbell](https://github.com/g-kimbell)
131
+
132
+ ## Acknowledgements
133
+
134
+ Special thanks to Julian Diener from Biologic for their advice and support.
135
+
136
+ This software was developed at the Laboratory of Materials for Energy Conversion at Empa, the Swiss Federal Laboratories for Materials Science and Technology, and supported by funding from the [IntelLiGent](https://heuintelligent.eu/) project from the European Union’s research and innovation program under grant agreement No. 101069765, and from the Swiss State Secretariat for Education, Research, and Innovation (SERI) under contract No. 22.001422.
137
+
138
+ <img src="https://github.com/user-attachments/assets/373d30b2-a7a4-4158-a3d8-f76e3a45a508#gh-light-mode-only" height="100" alt="IntelLiGent logo">
139
+ <img src="https://github.com/user-attachments/assets/9d003d4f-af2f-497a-8560-d228cc93177c#gh-dark-mode-only" height="100" alt="IntelLiGent logo">&nbsp;&nbsp;&nbsp;&nbsp;
140
+ <img src="https://github.com/user-attachments/assets/1d32a635-703b-432c-9d42-02e07d94e9a9" height="100" alt="EU flag">&nbsp;&nbsp;&nbsp;&nbsp;
141
+ <img src="https://github.com/user-attachments/assets/cd410b39-5989-47e5-b502-594d9a8f5ae1" height="100" alt="Swiss secretariat">
@@ -0,0 +1,9 @@
1
+ """Biologic API for Python."""
2
+
3
+ from .biologic import BiologicAPI
4
+ from .version import __version__
5
+
6
+ __all__ = [
7
+ "BiologicAPI",
8
+ "__version__",
9
+ ]