Skip to content

Commit f1851b6

Browse files
committed
Edits for PEP-8
1 parent 445600a commit f1851b6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sfs/mono/drivingfunction.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Compute driving functions for various systems."""
22

33
import numpy as np
4-
from numpy.core.umath_tests import inner1d # element-wise inner product
4+
from numpy.core.umath_tests import inner1d # element-wise inner product
55
from scipy.special import sph_jn, sph_yn, jn, hankel2
66
from .. import util
77
from .. import defs
@@ -357,7 +357,7 @@ def esa_edge_2d_plane(omega, x0, n=[0, 1, 0], alpha=3/2*np.pi, Nc=None, c=None):
357357
d = d + 1/epsilon[m] * np.exp(1j*nu*np.pi/2) * np.sin(nu*phi_s) \
358358
* np.cos(nu*phi) * nu/r * jn(nu, k*r)
359359

360-
d[phi>0] = -d[phi>0]
360+
d[phi > 0] = -d[phi > 0]
361361

362362
return 4*np.pi/alpha * d
363363

@@ -474,7 +474,7 @@ def esa_edge_2d_line(omega, x0, xs, alpha=3/2*np.pi, Nc=None, c=None):
474474
d[idx] = d[idx] + f[idx] * jn(nu, k*r[idx]) * hankel2(nu, k*r_s)
475475
d[~idx] = d[~idx] + f[~idx] * jn(nu, k*r_s) * hankel2(nu, k*r[~idx])
476476

477-
d[phi>0] = -d[phi>0]
477+
d[phi > 0] = -d[phi > 0]
478478

479479
return -1j*np.pi/alpha * d
480480

@@ -512,14 +512,14 @@ def esa_edge_25d_point(omega, x0, xs, xref=[2, -2, 0], alpha=3/2*np.pi, Nc=None,
512512
Complex weights of secondary sources.
513513
514514
"""
515-
x0 = np.asarray(x0)
515+
x0 = np.asarray(x0)
516516
xs = np.asarray(xs)
517517
xref = np.asarray(xref)
518-
519-
if np.ndim==1:
520-
a = np.linalg.norm(xref-x0, axis=1)/np.linalg.norm(xref-xs)
521-
else:
518+
519+
if np.isscalar(xref):
522520
a = np.linalg.norm(xref)/np.linalg.norm(xref-xs)
521+
else:
522+
a = np.linalg.norm(xref-x0, axis=1)/np.linalg.norm(xref-xs)
523523

524524
return 1j*np.sqrt(a) * esa_edge_2d_line(omega, x0, xs, alpha=alpha, Nc=Nc, c=c)
525525

0 commit comments

Comments
 (0)