-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
9,263 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 0 additions & 71 deletions
71
cellpy/readers/instruments/configurations/maccor_txt_four.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 41 additions & 46 deletions
87
cellpy/readers/instruments/configurations/maccor_txt_three.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,77 @@ | ||
# Works for data from WMG and UBham (SIMBA project) | ||
"""Configuration for tab-delimited Maccor txt files with two comment rows (used by WMG in the SIMBA project).""" | ||
|
||
# currently skips the comment rows instead of parsing them (change this by modifying the formatters | ||
# and add preprocessing step for parsing them) | ||
|
||
file_info = {"raw_extension": "txt"} | ||
|
||
unit_labels = { | ||
"resistance": "Ohms", | ||
"time": "s", | ||
"current": "Amps", | ||
"voltage": "Volts", | ||
"power": "Watt-hr", | ||
"capacity": "Amp-hr", | ||
"current": "A", | ||
"voltage": "V", | ||
"power": "W", | ||
"capacity": "Ah", | ||
"energy": "Wh", | ||
"temperature": "C", | ||
} | ||
|
||
prefixes = { | ||
"G": 1000_000_000, | ||
"M": 1000_000, | ||
"k": 1000.0, | ||
"h": 100.0, | ||
"d": 10.0, | ||
"c": 0.01, | ||
"m": 0.001, | ||
"micro": 0.000_001, | ||
"n": 0.000_000_001, | ||
} | ||
|
||
normal_headers_renaming_dict = { | ||
"data_point_txt": f"Rec#", | ||
"datetime_txt": f"DPt Time", | ||
"test_time_txt": f"TestTime", | ||
"step_time_txt": f"StepTime", | ||
"cycle_index_txt": f"Cyc#", | ||
"step_index_txt": f"Step", | ||
"data_point_txt": "Rec#", | ||
"cycle_index_txt": "Cyc#", | ||
"step_index_txt": "Step", | ||
"test_time_txt": "TestTime", | ||
"step_time_txt": "StepTime", | ||
"charge_capacity_txt": "mAmp-hr", | ||
"charge_energy_txt": "mWatt-hr", | ||
"current_txt": "mAmps", | ||
"voltage_txt": "Volts", | ||
"datetime_txt": "DPt Time", | ||
} | ||
|
||
file_info = {"raw_extension": "txt"} | ||
|
||
states = { | ||
"column_name": "State", | ||
"charge_keys": ["C"], | ||
"discharge_keys": ["D"], | ||
"rest_keys": ["R"], | ||
} | ||
|
||
|
||
raw_units = {"current": "A", "charge": "Ah", "mass": "g", "voltage": "V"} | ||
|
||
# raw_limits = { | ||
# "current_hard": 0.000_000_000_000_1, | ||
# "current_soft": 0.000_01, | ||
# "stable_current_hard": 2.0, | ||
# "stable_current_soft": 4.0, | ||
# "stable_voltage_hard": 2.0, | ||
# "stable_voltage_soft": 4.0, | ||
# "stable_charge_hard": 0.001, | ||
# "stable_charge_soft": 5.0, | ||
# "ir_change": 0.00001, | ||
# } | ||
raw_limits = { | ||
"current_hard": 0.000_000_000_000_1, | ||
"current_soft": 0.000_01, | ||
"stable_current_hard": 2.0, | ||
"stable_current_soft": 4.0, | ||
"stable_voltage_hard": 2.0, | ||
"stable_voltage_soft": 4.0, | ||
"stable_charge_hard": 0.001, | ||
"stable_charge_soft": 5.0, | ||
"ir_change": 0.00001, | ||
} | ||
|
||
formatters = { | ||
"skiprows": 3, # 12 for other file | ||
"skiprows": 2, | ||
"sep": "\t", | ||
"header": 0, # 0 for other file | ||
"header": 0, | ||
"encoding": "ISO-8859-1", # options: "ISO-8859-1", "utf-8", "cp1252" | ||
"decimal": ".", | ||
"thousands": ",", | ||
"decimal": ",", | ||
"thousands": None, | ||
} | ||
|
||
pre_processors = {} | ||
pre_processors = { | ||
"remove_empty_lines": True, | ||
} | ||
|
||
post_processors = { | ||
"get_column_names": True, | ||
"split_capacity": True, | ||
"split_current": False, | ||
"split_current": True, | ||
"set_index": True, | ||
"rename_headers": True, | ||
"remove_last_if_bad": True, | ||
"set_cycle_number_not_zero": True, | ||
"remove_last_if_bad": True, | ||
"convert_date_time_to_datetime": True, | ||
"convert_step_time_to_timedelta": True, | ||
"convert_test_time_to_timedelta": True, | ||
"convert_units": True, | ||
"select_columns_to_keep": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.