Commit 0f79050a authored by Grégoire GRZECZKOWICZ's avatar Grégoire GRZECZKOWICZ
Browse files

Add output csv file argument

parent 621b8890
......@@ -48,6 +48,9 @@ if __name__=="__main__":
can.add_argument("-a", "--variation-scale", metavar="RATIO", default=0.3, type=float,
help="Scale of the variation operators (as a ration of the domain width)")
can.add_argument("-o", "--output-file", metavar="NAME", default=None, type=str,
help="Output file where log are put")
the = can.parse_args()
# Minimum checks.
......@@ -63,6 +66,10 @@ if __name__=="__main__":
# Weird numpy way to ensure single line print of array.
np.set_printoptions(linewidth = np.inf)
# Default filename
if the.output_file == None:
the.output_file = the.solver
# Common termination and checkpointing.
history = []
......@@ -72,7 +79,7 @@ if __name__=="__main__":
make.iter(iters.max,
nb_it = the.iters),
make.iter(iters.save,
filename = the.solver+".csv",
filename = the.output_file+".csv",
fmt = "{it} ; {val} ; {sol}\n"),
make.iter(iters.log,
fmt="\r{it} {val}"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment