Skip to content
Snippets Groups Projects
Commit 7e19b88d authored by Thomas Kennedy's avatar Thomas Kennedy
Browse files

Expand Semester Project Input example

parent bfba4cc4
No related branches found
No related tags found
No related merge requests found
...@@ -15,8 +15,44 @@ def main(): ...@@ -15,8 +15,44 @@ def main():
input_temps = sys.argv[1] input_temps = sys.argv[1]
with open(input_temps, 'r') as temps_file: with open(input_temps, 'r') as temps_file:
for temps_as_floats in parse_raw_temps(temps_file): # Output raw structure
print(temps_as_floats) # for temps_as_floats in parse_raw_temps(temps_file):
# print(temps_as_floats)
# Split data
# for temps_as_floats in parse_raw_temps(temps_file):
# time, core_data = temps_as_floats
# print(f"{time = } | {core_data = }")
# Split Data
# times = []
# core_0_data = []
# core_1_data = []
# core_2_data = []
# core_3_data = []
# for time, core_data in parse_raw_temps(temps_file):
# times.append(time)
# core_0_data.append(core_data[0])
# core_1_data.append(core_data[1])
# core_2_data.append(core_data[2])
# core_3_data.append(core_data[3])
# print(f"{times[:4] = }")
# print(f"{core_0_data[:4] = }")
# for time, *temps in list(zip(times, core_0_data, core_1_data, core_2_data, core_3_data))[4:]:
# print(f"{time=} {temps=}")
# Split Data, but Better!
times = []
core_data = [[] for _ in range(0, 4)]
for time, raw_core_data in parse_raw_temps(temps_file):
times.append(time)
for core_idx, reading in enumerate(raw_core_data):
core_data[core_idx].append(reading)
for time, *temps in list(zip(times, *core_data))[4:]:
print(f"{time=} {temps=}")
if __name__ == "__main__": if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment