Skip to content

Commit 7126d8f

Browse files
committed
Added timestamp column to .mpr export
1 parent 90dd16c commit 7126d8f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/navani/echem.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def echem_file_loader(filepath: Union[str, Path], mass: float = None, area: floa
7676
gal_file = MPRfile(f)
7777

7878
df = pd.DataFrame(data=gal_file.data)
79+
df["timestamp"] = gal_file.timestamp + pd.to_timedelta(df["time/s"], unit="s")
7980
df = biologic_processing(df)
8081

8182
# arbin .res file - uses an sql server and requires mdbtools installed

tests/test_echem.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_mpr_reader():
9595
"../Example_data/jdb11-1_c3_gcpl_5cycles_2V-3p8V_C-24_data_C09.mpr"
9696
)
9797
df = ec.echem_file_loader(test_path)
98-
assert df.shape == (46102, 18)
98+
assert df.shape == (46102, 19)
9999

100100
cols = (
101101
"state",
@@ -116,6 +116,7 @@ def test_mpr_reader():
116116
"control/V/mA",
117117
"I Range",
118118
"flags",
119+
"timestamp",
119120
)
120121

121122
assert set(cols) == set(df)

0 commit comments

Comments
 (0)