From 40576db3892bfd2c5568518fabeeaa80324f4979 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Wed, 22 Feb 2017 10:11:13 +0000 Subject: [PATCH] autopep8 code cleanups. --- gprMax/constants.py | 8 ++++---- gprMax/input_cmds_multiuse.py | 4 ++-- gprMax/model_build_run.py | 2 +- gprMax/utilities.py | 14 +++++++------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gprMax/constants.py b/gprMax/constants.py index 7d9996a5..cf5f2e46 100644 --- a/gprMax/constants.py +++ b/gprMax/constants.py @@ -41,9 +41,9 @@ ccomplextype = 'pycuda::complex' # Double precision # For numpy arrays -#floattype = np.float64 -#complextype = np.complex128 +# floattype = np.float64 +# complextype = np.complex128 # For C (CUDA) arrays -#cfloattype = 'double' -#ccomplextype = 'pycuda::complex' +# cfloattype = 'double' +# ccomplextype = 'pycuda::complex' diff --git a/gprMax/input_cmds_multiuse.py b/gprMax/input_cmds_multiuse.py index aa611f09..a39ca622 100644 --- a/gprMax/input_cmds_multiuse.py +++ b/gprMax/input_cmds_multiuse.py @@ -269,7 +269,7 @@ def process_multicmds(multicmds, G): m.start = 0 m.stop = G.timewindow startstop = ' ' - + m.calculate_waveform_values(G) if G.messages: @@ -334,7 +334,7 @@ def process_multicmds(multicmds, G): t.start = 0 t.stop = G.timewindow startstop = ' ' - + t.calculate_waveform_values(G) t.calculate_incident_V_I(G) diff --git a/gprMax/model_build_run.py b/gprMax/model_build_run.py index c7c11192..b423de50 100644 --- a/gprMax/model_build_run.py +++ b/gprMax/model_build_run.py @@ -284,7 +284,7 @@ def solve_cpu(currentmodelrun, numbermodelruns, G): pbar = tqdm(total=snapiters, leave=False, unit='byte', unit_scale=True, desc=' Writing snapshot file {} of {}, {}'.format(i + 1, len(G.snapshots), os.path.split(snap.filename)[1]), ncols=get_terminal_width() - 1, file=sys.stdout, disable=G.tqdmdisable) snap.write_vtk_imagedata(G.Ex, G.Ey, G.Ez, G.Hx, G.Hy, G.Hz, G, pbar) pbar.close() - + # Update magnetic field components update_magnetic(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsH, G.ID, G.Ex, G.Ey, G.Ez, G.Hx, G.Hy, G.Hz) diff --git a/gprMax/utilities.py b/gprMax/utilities.py index 71397f0a..56b2285a 100644 --- a/gprMax/utilities.py +++ b/gprMax/utilities.py @@ -85,11 +85,11 @@ def open_path_file(path_or_file): Args: path_or_file: path as a string or a file object. - + Returns: f (object): File object. """ - + if isinstance(path_or_file, str): f = file_to_close = open(path_or_file, 'r') else: @@ -212,21 +212,21 @@ def memory_usage(G): Args: G (class): Grid class instance - holds essential parameters describing the model. - + Returns: memestimate (int): Estimate of required memory in bytes """ stdoverhead = 50e6 - + # 6 x field arrays + 6 x ID arrays fieldarrays = (6 + 6) * (G.nx + 1) * (G.ny + 1) * (G.nz + 1) * np.dtype(floattype).itemsize - + solidarray = G.nx * G.ny * G.nz * np.dtype(np.uint32).itemsize - + # 12 x rigidE array components + 6 x rigidH array components rigidarrays = (12 + 6) * G.nx * G.ny * G.nz * np.dtype(np.int8).itemsize - + pmlarrays = 0 for (k, v) in G.pmlthickness.items(): if v > 0: