Skip to content

Commit 2d31ea3

Browse files
committed
Add Set I/C values. (#212)
* fix mpt parsing * add Set I/C values for mpr * New test files * docs * add test files
1 parent 6bc714c commit 2d31ea3

File tree

13 files changed

+2887
-3
lines changed

13 files changed

+2887
-3
lines changed

docs/source/version.6_2.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
**yadg** version next
2+
`````````````````````
3+
..
4+
.. image:: https://img.shields.io/static/v1?label=yadg&message=v6.1&color=blue&logo=github
5+
:target: https://github.com/PeterKraus/yadg/tree/6.1
6+
.. image:: https://img.shields.io/static/v1?label=yadg&message=v6.1&color=blue&logo=pypi
7+
:target: https://pypi.org/project/yadg/6.1/
8+
.. image:: https://img.shields.io/static/v1?label=release%20date&message=2025-06-03&color=red&logo=pypi
9+
10+
11+
Developed in the `ConCat Lab <https://tu.berlin/en/concat>`_ at Technische Universität Berlin (Berlin, DE).
12+
13+
New features in ``yadg-next`` are:
14+
15+
16+
Breaking changes in ``yadg-next`` are:
17+
18+
19+
Bug fixes in ``yadg-next`` include:
20+
21+
- Fixed metadata extraction in :mod:`yadg.extractors.eclab.mpt` where ``control_*`` columns would not match the names present in the corresponding ``mpr`` files.
22+
- Added further ``Set I/C`` parameters. Thanks to `@Locki3 <https://github.com/Locki3>`_ for providing test files.

docs/source/version.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
**yadg** version history
22
------------------------
33

4+
.. include:: version.6_2.rst
5+
46
.. include:: version.6_1.rst
57

68
.. include:: version.6_0.rst

src/yadg/extractors/eclab/mpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def process_data(
421421

422422
if "control_V_I" in vals:
423423
icv = controls[Ns]
424-
name = "control_I" if icv in {"I", "C"} else "control_V" # f"control_{icv}"
424+
name = "control_I" if icv in {"I", "C"} else "control_V"
425425
vals[name] = vals.pop("control_V_I")
426426
units[name] = "mA" if icv in {"I", "C"} else "V"
427427
devs = get_devs(vals=vals, units=units, Erange=Erange, Irange=Irange)

src/yadg/extractors/eclab/mpt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def process_data(
287287

288288
if "control_VI" in vals:
289289
icv = controls[Ns] if isinstance(controls, list) else controls
290-
name = f"control_{icv}"
290+
name = "control_I" if icv in {"I", "C"} else "control_V"
291291
vals[name] = vals.pop("control_VI")
292292
units[name] = "mA" if icv in {"I", "C"} else "V"
293293
devs = get_devs(vals=vals, units=units, Erange=Erange, Irange=Irange, devs=devs)

src/yadg/extractors/eclab/mpt_columns.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@
6969
"Efficiency/%": ("Efficiency", "%"),
7070
"Energy charge/W.h": ("Energy charge", "W·h"),
7171
"Energy discharge/W.h": ("Energy discharge", "W·h"),
72+
"Energy ce charge/W.h": ("Energy ce charge", "W·h"),
73+
"Energy ce discharge/W.h": ("Energy ce discharge", "W·h"),
74+
"Energy we charge/W.h": ("Energy we charge", "W·h"),
75+
"Energy we discharge/W.h": ("Energy we discharge", "W·h"),
76+
"Energy we-ce charge/W.h": ("Energy we-ce charge", "W·h"),
77+
"Energy we-ce discharge/W.h": ("Energy we-ce discharge", "W·h"),
7278
"Energy/W.h": ("Energy", "W·h"),
7379
"error": ("error", None),
7480
"Ewe-Ece/V": ("Ewe-Ece", "V"),
@@ -97,7 +103,9 @@
97103
"Phase(Z)/deg": ("Phase(Z)", "deg"),
98104
"Phase(Zce)/deg": ("Phase(Zce)", "deg"),
99105
"Phase(Zwe-ce)/deg": ("Phase(Zwe-ce)", "deg"),
106+
"Pce/W": ("Pce", "W"),
100107
"Pwe/W": ("Pwe", "W"),
108+
"Pwe-ce/W": ("Pwe-ce", "W"),
101109
"Q charge/discharge/mA.h": ("Q charge or discharge", "mA·h"),
102110
"Q charge/mA.h": ("Q charge", "mA·h"),
103111
"Q charge/mA.h/g": ("Q charge", "mA·h/g"),
@@ -115,6 +123,8 @@
115123
"Re(Zce)/Ohm": ("Re(Zce)", "Ω"),
116124
"Re(Zwe-ce)/Ohm": ("Re(Zwe-ce)", "Ω"),
117125
"Rwe/Ohm": ("Rwe", "Ω"),
126+
"Rce/Ohm": ("Rce", "Ω"),
127+
"Rwe-ce/Ohm": ("Rwe-ce", "Ω"),
118128
"step time/s": ("step time", "s"),
119129
"Tan(Delta)": ("Tan(Delta)", ""),
120130
"THD Ewe/%": ("THD Ewe", "%"),

src/yadg/extractors/eclab/techniques.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,8 @@
15131513
"Set I/C": (
15141514
("I", 0),
15151515
("C", 1),
1516+
("C x N", 2),
1517+
("C / N", 3),
15161518
),
15171519
"Apply I/C": (
15181520
("I", 0),

tests/test_x_eclab.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def test_eclab_consistency_partial_1(froot, locale, datadir):
156156
[
157157
("gcpl.pr_182.1", "en_US"),
158158
("gcpl.pr_182.2", "en_US"),
159+
("gcpl.issue_211", "en_US"),
159160
],
160161
)
161162
def test_eclab_consistency_partial_2(froot, locale, datadir):
@@ -167,7 +168,7 @@ def test_eclab_consistency_partial_2(froot, locale, datadir):
167168
for key in aret.variables:
168169
if key.endswith("std_err"):
169170
continue
170-
elif key in {"control_I"}:
171+
elif key in {"control_I", "control_V", "Energy charge", "Energy discharge"}:
171172
continue
172173
try:
173174
xr.testing.assert_allclose(aret[key], bret[key])
203 KB
Binary file not shown.
697 KB
Binary file not shown.

tests/test_x_eclab/gcpl.issue_211.mpt

Lines changed: 2847 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)