Skip to content

Commit

Permalink
test files
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterKraus committed Jun 30, 2024
1 parent 13a352b commit b89d985
Show file tree
Hide file tree
Showing 22 changed files with 1,620 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/yadg/extractors/eclab/common/mpr_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,15 @@
178: ("<f4", "(Q-Qo)", "C"),
179: ("<f4", "dQ", "C"),
182: ("<f8", "step time", "s"),
211: ("<f8", "Q charge or discharge", "C"),
241: ("<f4", "|E1|", "V"),
242: ("<f4", "|E2|", "V"),
271: ("<f4", "Phase(Z1)", "deg"),
272: ("<f4", "Phase(Z2)", "deg"),
295: ("<u2", "I Range", None),
301: ("<f4", "|Z1|", "Ω"),
302: ("<f4", "|Z2|", "Ω"),
326: ("<f4", "P", "W"),
331: ("<f4", "Re(Z1)", "Ω"),
332: ("<f4", "Re(Z2)", "Ω"),
361: ("<f4", "-Im(Z1)", "Ω"),
Expand Down
37 changes: 37 additions & 0 deletions src/yadg/extractors/eclab/common/techniques.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,43 @@
("goto_Ns", "<u4"),
("nc_cycles", "<u4"),
]
),
np.dtype(
[
("set_I/C", "|u1"),
("Is", "<f4"),
("Is_unit", "|u1"),
("Is_vs", "|u4"),
("N", "<f4"),
("I_sign", "|u4"),
("t1", "<f4"),
("I_range", "|u1"),
("bandwidth", "|u1"),
("dE1", "<f4"),
("dt1", "<f4"),
("EM", "<f4"),
("tM", "<f4"),
("Im", "<f4"),
("Im_unit", "|u1"),
("dI/dt", "<f4"),
("dI/dt_unit", "|u1"),
("E_range_min", "<f4"),
("E_range_max", "<f4"),
("dq", "<f4"),
("dq_unit", "|u1"),
("dtq", "<f4"),
("dQM", "<f4"),
("dQM_unit", "|u1"),
("dxM", "<f4"),
("delta SoC", "<f4"),
("tR", "<f4"),
("dER/dt", "<f4"),
("dER", "<f4"),
("dtR", "<f4"),
("EL", "<f4"),
("goto_Ns", "u4"),
("nc_cycles", "u4"),
]
)
]

Expand Down
10 changes: 10 additions & 0 deletions src/yadg/extractors/eclab/mpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,15 @@ def process_settings(data: bytes) -> tuple[dict, list]:
count=ns,
)
pardicts = [dict(zip(value.dtype.names, value.item())) for value in rawparams]
# print(f"{[i['set_I/C'] for i in pardicts]=}")
# print(f"{[i['Is'] for i in pardicts]=}")
# print(f"{[i['Is_unit'] for i in pardicts]=}")
# print(f"{[i['Is_vs'] for i in pardicts]=}")
# print(f"{[i['N'] for i in pardicts]=}")
# print(f"{[i['I_sign'] for i in pardicts]=}")
# print(f"{[i['t1'] for i in pardicts]=}")
# print(f"{[i['I_range'] for i in pardicts]=}")
# print(f"{[i['bandwidth'] for i in pardicts]=}")
params = []
for pardict in pardicts:
for k, v in pardict.items():
Expand All @@ -304,6 +313,7 @@ def process_settings(data: bytes) -> tuple[dict, list]:
# Handle NaNs and +/-Inf in params here
if np.isnan(v) or np.isinf(v):
pardict[k] = str(v)
print(f"{pardict=}")
params.append(pardict)
return settings, params

Expand Down
3 changes: 3 additions & 0 deletions tests/test_x_eclab.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def _datadir(tmpdir, request):
("cv.issue_149.mpr", "cv.issue_149.mpt", "de_DE"),
("cva.issue_135.mpr", "cva.issue_135.mpt", "en_US"),
("gcpl.mpr", "gcpl.mpt", "en_US"),
("gcpl.issue_149.mpr", "gcpl.issue_149.mpt", "de_DE"),
("geis.mpr", "geis.mpt", "en_US"),
("lsv.mpr", "lsv.mpt", "en_US"),
("mb.mpr", "mb.mpt", "en_US"),
Expand All @@ -46,6 +47,8 @@ def test_eclab_consistency(afile, bfile, locale, _datadir):
bret = extract_mpt(
fn=bfile, timezone="Europe/Berlin", encoding="windows-1252", locale=locale
)
print(f"{aret.data_vars=}")
print(f"{bret.data_vars=}")
for key in aret.variables:
if key.endswith("std_err"):
continue
Expand Down
Binary file added tests/test_x_eclab_mpr/ca.issue_149.mpr
Binary file not shown.
Binary file added tests/test_x_eclab_mpr/cp.issue_149.mpr
Binary file not shown.
Binary file added tests/test_x_eclab_mpr/gcpl.issue_149.mpr
Binary file not shown.
Binary file added tests/test_x_eclab_mpr/gcpl.issue_149.mpr.pkl
Binary file not shown.
Binary file added tests/test_x_eclab_mpr/geis.issue_149.mpr
Binary file not shown.
Binary file added tests/test_x_eclab_mpr/mb.issue_149.mpr
Binary file not shown.
Binary file added tests/test_x_eclab_mpr/ocv.issue_149.mpr
Binary file not shown.
Binary file added tests/test_x_eclab_mpr/peis.issue_149.mpr
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/test_x_eclab_mpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
[
("ca.mpt", "en_GB"),
("ca.issue_134.mpt", "en_GB"),
("ca.issue_149.mpt", "de_DE"),
("cp.mpt", "en_GB"),
("cp.issue_61.mpt", "en_GB"),
("cv.mpt", "en_GB"),
("cv.issue_149.mpt", "de_DE"),
("cva.issue_135.mpt", "en_GB"),
("gcpl.mpt", "en_GB"),
("gcpl.issue_149.mpt", "de_DE"),
("geis.mpt", "en_GB"),
("lsv.mpt", "en_GB"),
("mb.mpt", "en_GB"),
Expand Down
152 changes: 152 additions & 0 deletions tests/test_x_eclab_mpt/ca.issue_149.mpt

Large diffs are not rendered by default.

Binary file added tests/test_x_eclab_mpt/ca.issue_149.mpt.pkl
Binary file not shown.
107 changes: 107 additions & 0 deletions tests/test_x_eclab_mpt/cp.issue_149.mpt

Large diffs are not rendered by default.

213 changes: 213 additions & 0 deletions tests/test_x_eclab_mpt/gcpl.issue_149.mpt

Large diffs are not rendered by default.

Binary file added tests/test_x_eclab_mpt/gcpl.issue_149.mpt.pkl
Binary file not shown.
161 changes: 161 additions & 0 deletions tests/test_x_eclab_mpt/geis.issue_149.mpt

Large diffs are not rendered by default.

678 changes: 678 additions & 0 deletions tests/test_x_eclab_mpt/mb.issue_149.mpt

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions tests/test_x_eclab_mpt/ocv.issue_149.mpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
EC-Lab ASCII FILE
Nb header lines : 54

Open Circuit Voltage

Run on channel : 1 (SN 15265)
User :
Electrode connection : standard
Potential control : Ewe
Ewe ctrl range : min = 3,00 V, max = 4,50 V
Ewe,I filtering : 50 kHz
Safety Limits :
Do not start on E overload
Channel : Floating
Acquisition started on : 01/10/2024 11:02:29.886
Technique started on : 01/10/2024 11:02:30.886
Loaded Setting File : NONE
Saved on :
File : ***.mpr
Directory : C:\Users\***\
Host : 169.254.189.50
Device : SP-300 (SN 1854)
Address : 169.254.189.65
EC-Lab for windows v11.50 (software)
Internet server v11.50 (firmware)
Command interpretor v11.50 (firmware)
Electrode material :
Initial state :
Electrolyte :
Comments :
Cable : standard
Electrode surface area : 0,000 cm�
Characteristic mass : 0,001 g
Equivalent Weight : 0,000 g/eq.
Density : 0,000 g/cm3
Volume (V) : 0,001 cm�
Record Power
Record EIS quality indicators
Cycle Definition : Charge/Discharge alternance
tR (h:m:s) 0:00:10,0000
dER/dt (mV/h) 0,0
record <Ewe>
dER (mV) 0,00
dtR (s) 1,0000
E range min (V) 3,000
E range max (V) 4,500

Number of loops : 4
Loop 0 from point number 0 to 9
Loop 1 from point number 10 to 20
Loop 2 from point number 21 to 31
Loop 3 from point number 32 to 42

mode error time/s <Ewe/V>
3 1 9,999999747378752E-001 3,4206879E+000
3 0 1,999999949475750E+000 3,4206829E+000
3 0 2,999999924213625E+000 3,4206815E+000
3 0 3,999999898951501E+000 3,4206827E+000
3 0 4,999999873689376E+000 3,4206798E+000
3 0 5,999999848427251E+000 3,4206772E+000
3 0 6,999999823165126E+000 3,4206753E+000
3 0 7,999999797903001E+000 3,4206722E+000
3 0 8,999999772640876E+000 3,4206650E+000
3 0 9,999799747383804E+000 3,4206650E+000
3 0 2,014195992963068E+002 3,4372160E+000
3 0 2,024195992710447E+002 3,4344788E+000
3 0 2,034195992457826E+002 3,4335892E+000
3 0 2,044195992205205E+002 3,4330478E+000
3 0 2,054195991952583E+002 3,4326522E+000
3 0 2,064195991699962E+002 3,4323306E+000
3 0 2,074195991447341E+002 3,4320710E+000
3 0 2,084195991194720E+002 3,4318550E+000
3 0 2,094195990942098E+002 3,4316723E+000
3 0 2,104195990689477E+002 3,4315083E+000
3 0 2,104203990689275E+002 3,4314282E+000
3 0 4,012301985888771E+002 3,4422569E+000
3 0 4,022301985636150E+002 3,4396782E+000
3 0 4,032301985383529E+002 3,4388745E+000
3 0 4,042301985130907E+002 3,4383748E+000
3 0 4,052301984878286E+002 3,4380076E+000
3 0 4,062301984625665E+002 3,4377244E+000
3 0 4,072301984373044E+002 3,4374819E+000
3 0 4,082301984120422E+002 3,4372745E+000
3 0 4,092301983867801E+002 3,4370923E+000
3 0 4,102301983615180E+002 3,4369333E+000
3 0 4,102309983614978E+002 3,4368458E+000
3 0 6,008317978715204E+002 3,4460111E+000
3 0 6,018317978462583E+002 3,4435616E+000
3 0 6,028317978209961E+002 3,4428005E+000
3 0 6,038317977957340E+002 3,4423366E+000
3 0 6,048317977704719E+002 3,4419944E+000
3 0 6,058317977452098E+002 3,4417188E+000
3 0 6,068317977199476E+002 3,4415019E+000
3 0 6,078317976946855E+002 3,4413135E+000
3 0 6,088317976694234E+002 3,4411368E+000
3 0 6,098317976441613E+002 3,4409854E+000
3 0 6,098325976441411E+002 3,4408994E+000
Loading

0 comments on commit b89d985

Please sign in to comment.