fix: properly write output file and headers
This commit is contained in:
parent
980b311372
commit
6334aae223
@ -124,7 +124,7 @@ def write_time_series(dipoles_file, dots_file, measurement_type, delta_t, num_it
|
||||
labels = [dot.label for dot in dots]
|
||||
if header_row:
|
||||
value_labels = ", ".join([f"{value_name}_{label}" for label in labels])
|
||||
click.echo(f"t (s), {value_labels}")
|
||||
output_file.write(f"t (s), {value_labels}\n")
|
||||
|
||||
_logger.debug(f"Going to simulate {num_iterations} iterations with a delta t of {delta_t}")
|
||||
|
||||
@ -138,7 +138,7 @@ def write_time_series(dipoles_file, dots_file, measurement_type, delta_t, num_it
|
||||
for i in tqdm.trange(num_iterations):
|
||||
transition = time_series.transition()
|
||||
transition_values = ", ".join(str(transition[label]) for label in labels)
|
||||
output_file.write(f"{i * delta_t}, {transition_values}")
|
||||
output_file.write(f"{i * delta_t}, {transition_values}\n")
|
||||
|
||||
|
||||
@cli.command()
|
||||
|
Loading…
x
Reference in New Issue
Block a user