From 2b96e5dd849b2667b54475b42b85d7eeccd6e2a1 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 11 Jul 2021 17:05:42 -0700 Subject: [PATCH] simplify print --- opencl_fdtd/simulation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opencl_fdtd/simulation.py b/opencl_fdtd/simulation.py index 4fa4bae..e06825c 100644 --- a/opencl_fdtd/simulation.py +++ b/opencl_fdtd/simulation.py @@ -31,8 +31,8 @@ class Simulation(object): pmls = [{'axis': a, 'polarity': p} for a in 'xyz' for p in 'np'] sim = Simulation(grid.grids, do_poynting=True, pmls=pmls) - with open('sources.c', 'w') as f: - f.write('{}'.format(sim.sources)) + with open('sources.c', 'wt') as f: + f.write(repr(sim.sources)) for t in range(max_t): sim.update_E([]).wait()