ionworks-api 0.1.0__py3-none-any.whl → 0.1.3__py3-none-any.whl
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.
- ionworks/__init__.py +27 -2
- ionworks/cell_instance.py +54 -48
- ionworks/cell_measurement.py +95 -58
- ionworks/cell_specification.py +106 -19
- ionworks/client.py +37 -8
- ionworks/errors.py +22 -5
- ionworks/job.py +90 -36
- ionworks/models.py +29 -37
- ionworks/pipeline.py +113 -4
- ionworks/simulation.py +127 -74
- ionworks/validators.py +553 -32
- {ionworks_api-0.1.0.dist-info → ionworks_api-0.1.3.dist-info}/METADATA +36 -17
- ionworks_api-0.1.3.dist-info/RECORD +15 -0
- ionworks_api-0.1.3.dist-info/licenses/LICENSE.md +21 -0
- ionworks_api-0.1.0.dist-info/RECORD +0 -14
- {ionworks_api-0.1.0.dist-info → ionworks_api-0.1.3.dist-info}/WHEEL +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ionworks-api
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Python client for interacting with the Ionworks API
|
|
5
|
+
License-File: LICENSE.md
|
|
5
6
|
Requires-Python: >=3.10
|
|
6
7
|
Requires-Dist: black
|
|
7
8
|
Requires-Dist: iwutil
|
|
8
9
|
Requires-Dist: numpy
|
|
9
10
|
Requires-Dist: pandas
|
|
10
|
-
Requires-Dist: polars
|
|
11
|
+
Requires-Dist: polars-lts-cpu
|
|
11
12
|
Requires-Dist: pyarrow
|
|
12
13
|
Requires-Dist: pybamm>=25.10.0
|
|
13
14
|
Requires-Dist: pydantic>=2.6.0
|
|
@@ -17,6 +18,10 @@ Requires-Dist: supabase
|
|
|
17
18
|
Requires-Dist: types-requests>=2.31.0
|
|
18
19
|
Provides-Extra: dev
|
|
19
20
|
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
21
|
+
Provides-Extra: docs
|
|
22
|
+
Requires-Dist: furo; extra == 'docs'
|
|
23
|
+
Requires-Dist: myst-nb>=1.0.0; extra == 'docs'
|
|
24
|
+
Requires-Dist: sphinx>=7.0.0; extra == 'docs'
|
|
20
25
|
Description-Content-Type: text/markdown
|
|
21
26
|
|
|
22
27
|
# Ionworks API Client
|
|
@@ -34,7 +39,13 @@ A Python client for interacting with the Ionworks API.
|
|
|
34
39
|
pip install -e .
|
|
35
40
|
```
|
|
36
41
|
|
|
37
|
-
3.
|
|
42
|
+
3. Copy the example environment file and fill in your credentials:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
cp .env.example .env
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Get your API key from the [Ionworks account settings](https://app.ionworks.com/dashboard/account) and your project ID from your project settings page. See [Environment Setup](#environment-setup) for details.
|
|
38
49
|
|
|
39
50
|
## Usage
|
|
40
51
|
|
|
@@ -185,7 +196,6 @@ Available element types:
|
|
|
185
196
|
- `validation`: Validate model against data
|
|
186
197
|
|
|
187
198
|
```python
|
|
188
|
-
import time
|
|
189
199
|
from ionworks import Ionworks
|
|
190
200
|
|
|
191
201
|
client = Ionworks()
|
|
@@ -236,22 +246,15 @@ pipeline_config = {
|
|
|
236
246
|
},
|
|
237
247
|
}
|
|
238
248
|
|
|
239
|
-
# Submit pipeline
|
|
249
|
+
# Submit pipeline and wait for completion
|
|
240
250
|
pipeline = client.pipeline.create(pipeline_config)
|
|
241
251
|
print(f"Pipeline submitted: {pipeline.id}")
|
|
242
252
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
result = client.pipeline.result(pipeline.id)
|
|
249
|
-
print("Fitted parameters:", result.element_results["fit data"])
|
|
250
|
-
break
|
|
251
|
-
elif pipeline.status == "failed":
|
|
252
|
-
print("Pipeline failed:", pipeline.error)
|
|
253
|
-
break
|
|
254
|
-
time.sleep(2)
|
|
253
|
+
pipeline = client.pipeline.wait_for_completion(pipeline.id, timeout=600)
|
|
254
|
+
|
|
255
|
+
if pipeline.status == "completed":
|
|
256
|
+
result = client.pipeline.result(pipeline.id)
|
|
257
|
+
print("Fitted parameters:", result.element_results["fit data"])
|
|
255
258
|
```
|
|
256
259
|
|
|
257
260
|
### Running simulations
|
|
@@ -307,6 +310,22 @@ simulation_data = client.simulation.get_result(result.simulation_id)
|
|
|
307
310
|
time_series = simulation_data.get("time_series", {})
|
|
308
311
|
```
|
|
309
312
|
|
|
313
|
+
## Environment Setup
|
|
314
|
+
|
|
315
|
+
The client uses environment variables for configuration. Copy the example file and fill in your values:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
cp .env.example .env
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
| Variable | Required | Default | Description |
|
|
322
|
+
|---|---|---|---|
|
|
323
|
+
| `IONWORKS_API_KEY` | Yes | — | API key from [account settings](https://app.ionworks.com/dashboard/account) |
|
|
324
|
+
| `IONWORKS_API_URL` | No | `https://api.ionworks.com` | API base URL |
|
|
325
|
+
| `PROJECT_ID` | For pipelines | — | Project ID from your project settings page |
|
|
326
|
+
|
|
327
|
+
The client loads `.env` automatically via `python-dotenv`.
|
|
328
|
+
|
|
310
329
|
## Error Handling
|
|
311
330
|
|
|
312
331
|
The client will raise exceptions in the following cases:
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ionworks/__init__.py,sha256=dyCh0A5wTmk0Znq1F0fGm5b0uQJ_dpWPBsoL4A4pc7I,575
|
|
2
|
+
ionworks/cell_instance.py,sha256=1ylUrh5HbqR5nwn8UNEuTuwxakHDoo6wSippNjeGE58,8046
|
|
3
|
+
ionworks/cell_measurement.py,sha256=m4XLospN-RrmQhojpkSPr96ngwCW0-SkqbpsTEj_JKk,13366
|
|
4
|
+
ionworks/cell_specification.py,sha256=fe3TlpRPZnU1V4vgo4oS4WyAzItJprW5FKiwHkHIbms,6420
|
|
5
|
+
ionworks/client.py,sha256=laSKr0XFpXWz_xMXL2mGa0FVZd3t_G7oZoJokUc1l9I,5852
|
|
6
|
+
ionworks/errors.py,sha256=zx1KoWGhMyA4Livokkt7kcB-dj0DEPIPA9AzaS3TESU,1491
|
|
7
|
+
ionworks/job.py,sha256=1YZGM5d8UU8UIU2e6fQpap_6NU7E1gnD1OungXrWy30,4747
|
|
8
|
+
ionworks/models.py,sha256=Zb_srLk1e7dt3juv0vE-6J8Pil08tbbJTJLoyZ0RCrs,4661
|
|
9
|
+
ionworks/pipeline.py,sha256=vhMzXnZtdL0MxV_9TaEStIU0W-lFUhoP0remixhm374,11935
|
|
10
|
+
ionworks/simulation.py,sha256=c9QSF8YBUSP90uEDzLU-ANLsyzVu4MY6wQBWuRfGciw,14982
|
|
11
|
+
ionworks/validators.py,sha256=HKwVJzIAkKnWLXJVxw8M7hlG7qqgslqEuHN3yNaaA6s,22320
|
|
12
|
+
ionworks_api-0.1.3.dist-info/METADATA,sha256=cM3CBDk8pvD4LzXuzMy91qbF365c170LxT6tQDDPbRE,9922
|
|
13
|
+
ionworks_api-0.1.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
14
|
+
ionworks_api-0.1.3.dist-info/licenses/LICENSE.md,sha256=MaRldz8wcFVJcX3KzjWwjj8QaFeFd3FwB0mB8hQMLQo,1082
|
|
15
|
+
ionworks_api-0.1.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ionworks Technologies Inc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
ionworks/__init__.py,sha256=OCNLH4VyRyH8SVjrNf-XmeltpvDBcAqwSWVJ2y2YMcY,85
|
|
2
|
-
ionworks/cell_instance.py,sha256=BGssFTos_U4EBVmbTRr-WjXmL5ZGu57c0FweEzM_QB4,7649
|
|
3
|
-
ionworks/cell_measurement.py,sha256=DfcgQMMs6K9Rc0SFjXgC3jWo-nQ-Wff_Bk_1Qys2lAo,11918
|
|
4
|
-
ionworks/cell_specification.py,sha256=mr_H3ppFWoEB4bwQb6SaX-OgZdACw2JEJvrfIKV_d8o,3944
|
|
5
|
-
ionworks/client.py,sha256=PPX2TGrKC64phNKglZJvJPFJl8oEB5qrmsre8h27ltI,4842
|
|
6
|
-
ionworks/errors.py,sha256=9aTLnXgusWnRaegkWMsfXj4EDnqQ8vbvv0C_QAzSWKU,972
|
|
7
|
-
ionworks/job.py,sha256=0ZokfwjhX4kseM3dl3CPKB5jr6-MzYuNJU4DUn7bck8,3505
|
|
8
|
-
ionworks/models.py,sha256=DIm69Q_9GuR-XVMvhyvqhrZQuWVB6puHb_Tr1R7a7D8,4581
|
|
9
|
-
ionworks/pipeline.py,sha256=_nDHQRIrc_g-k_OnrkFnIyOVNlwlMZgrppB-9tiLPO0,8403
|
|
10
|
-
ionworks/simulation.py,sha256=ZHbIAz4UVTloUismjNSzAqzzKOaF_QijZtAKuWc0lIg,13860
|
|
11
|
-
ionworks/validators.py,sha256=84hIefvXYvndkezEgnnxxmFeyLvCSr3d0wcbX9wRAWM,5728
|
|
12
|
-
ionworks_api-0.1.0.dist-info/METADATA,sha256=hNFyvwrWXLf9nnYdbgeoRy1k6lPR75sEathLS7NNqCU,9235
|
|
13
|
-
ionworks_api-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
14
|
-
ionworks_api-0.1.0.dist-info/RECORD,,
|
|
File without changes
|