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

Tweak Semester Project Input example

parent 7e19b88d
No related branches found
No related tags found
No related merge requests found
......@@ -15,34 +15,45 @@ def main():
input_temps = sys.argv[1]
with open(input_temps, 'r') as temps_file:
# ----------------------------------------------------------------------
# Output raw structure
# for temps_as_floats in parse_raw_temps(temps_file):
# print(temps_as_floats)
# ----------------------------------------------------------------------
for temps_as_floats in parse_raw_temps(temps_file):
print(temps_as_floats)
with open(input_temps, 'r') as temps_file:
# ----------------------------------------------------------------------
# Split data
# for temps_as_floats in parse_raw_temps(temps_file):
# time, core_data = temps_as_floats
# print(f"{time = } | {core_data = }")
# ----------------------------------------------------------------------
for temps_as_floats in parse_raw_temps(temps_file):
time, core_data = temps_as_floats
print(f"{time = } | {core_data = }")
with open(input_temps, 'r') as temps_file:
# ----------------------------------------------------------------------
# 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=}")
# ----------------------------------------------------------------------
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=}")
with open(input_temps, 'r') as temps_file:
# ----------------------------------------------------------------------
# Split Data, but Better!
# ----------------------------------------------------------------------
times = []
core_data = [[] for _ in range(0, 4)]
......
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