PEP8 code cleanups.

这个提交包含在:
Craig Warren
2018-01-02 18:14:20 +00:00
父节点 f83ec97fa9
当前提交 4848a8d4d7
共有 15 个文件被更改,包括 83 次插入90 次删除

查看文件

@@ -217,17 +217,17 @@ class MagneticDipole(Source):
def gpu_initialise_src_arrays(sources, G):
"""Initialise arrays on GPU for source coordinates/polarisation, other source information, and source waveform values.
Args:
sources (list): List of sources of one class, e.g. HertzianDipoles.
G (class): Grid class instance - holds essential parameters describing the model.
Returns:
srcinfo1_gpu (int): numpy array of source cell coordinates and polarisation information.
srcinfo2_gpu (float): numpy array of other source information, e.g. length, resistance etc...
srcwaves_gpu (float): numpy array of source waveform values.
"""
import pycuda.gpuarray as gpuarray
srcinfo1 = np.zeros((len(sources), 4), dtype=np.int32)
@@ -237,14 +237,14 @@ def gpu_initialise_src_arrays(sources, G):
srcinfo1[i, 0] = src.xcoord
srcinfo1[i, 1] = src.ycoord
srcinfo1[i, 2] = src.zcoord
if src.polarisation == 'x':
srcinfo1[i, 3] = 0
elif src.polarisation == 'y':
srcinfo1[i, 3] = 1
elif src.polarisation == 'z':
srcinfo1[i, 3] = 2
if src.__class__.__name__ == 'HertzianDipole':
srcinfo2[i] = src.dl
srcwaves[i, :] = src.waveformvaluesJ
@@ -253,7 +253,7 @@ def gpu_initialise_src_arrays(sources, G):
srcwaves[i, :] = src.waveformvaluesJ
elif src.__class__.__name__ == 'MagneticDipole':
srcwaves[i, :] = src.waveformvaluesM
srcinfo1_gpu = gpuarray.to_gpu(srcinfo1)
srcinfo2_gpu = gpuarray.to_gpu(srcinfo2)
srcwaves_gpu = gpuarray.to_gpu(srcwaves)