Skip to content

Commit

Permalink
Store a identifier for each test
Browse files Browse the repository at this point in the history
  • Loading branch information
WardLT committed Feb 26, 2024
1 parent 85c52ac commit 24eb47b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions batdata/extractors/batterydata.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def convert_eis_data_to_batdata(input_df: pd.DataFrame) -> pd.DataFrame:
EIS data in batdata format
"""

# Store frequency
# Use the cycle index as a test index
output = pd.DataFrame()
output['frequency'] = input_df['Frequency_Hz']
output['test_id'] = input_df['Cycle_Index']

# Drop units off and make lower case
cols = ['Frequency_Hz', 'Z_Imag_Ohm', 'Z_Real_Ohm', 'Z_Mag_Ohm', 'Z_Phase_Degree']
Expand Down
1 change: 1 addition & 0 deletions batdata/schemas/eis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
class EISData(ColumnSchema):
"""Measurements for a specific EIS test"""

test_id: List[int] = Field(..., description='Integer used to identify rows belonging to the same experiment.')
test_time: List[float] = Field(None, description="Time from the beginning of the cycling test. Times must be "
"nonnegative and monotonically increasing. Units: s",
monotonic=True)
Expand Down
1 change: 1 addition & 0 deletions tests/schemas/test_eis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@fixture()
def example_df() -> pd.DataFrame:
output = pd.DataFrame({
'test_id': [1, 1],
'frequency': [5e5, 4e5],
'z_real': [0.241, 0.237],
'z_imag': [0.431, 0.327],
Expand Down

0 comments on commit 24eb47b

Please sign in to comment.