Skip to content

Commit 2620bd5

Browse files
committed
Get -> Return, line length <=79
adding mgeier suggestions
1 parent 10d9705 commit 2620bd5

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

sfs/array.py

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
class ArrayData(namedtuple('ArrayData', 'x n a')):
18-
"""Get named tuple returned by array functions.
18+
"""Named tuple returned by array functions.
1919
2020
See `collections.namedtuple`.
2121
@@ -43,7 +43,7 @@ def take(self, indices):
4343

4444

4545
def linear(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
46-
"""Get linear, equidistantly sampled secondary source distribution.
46+
"""Return linear, equidistantly sampled secondary source distribution.
4747
4848
Parameters
4949
----------
@@ -78,7 +78,7 @@ def linear(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
7878

7979

8080
def linear_diff(distances, center=[0, 0, 0], orientation=[1, 0, 0]):
81-
"""Get linear secondary source distribution from a list of distances.
81+
"""Return linear secondary source distribution from a list of distances.
8282
8383
Parameters
8484
----------
@@ -112,7 +112,7 @@ def linear_diff(distances, center=[0, 0, 0], orientation=[1, 0, 0]):
112112

113113
def linear_random(N, min_spacing, max_spacing, center=[0, 0, 0],
114114
orientation=[1, 0, 0], seed=None):
115-
"""Get randomly sampled linear array.
115+
"""Return randomly sampled linear array.
116116
117117
Parameters
118118
----------
@@ -136,7 +136,10 @@ def linear_random(N, min_spacing, max_spacing, center=[0, 0, 0],
136136
.. plot::
137137
:context: close-figs
138138
139-
x0, n0, a0 = sfs.array.linear_random(12, 0.15, 0.4, orientation=[0, -1, 0])
139+
x0, n0, a0 = sfs.array.linear_random(
140+
N=12,
141+
min_spacing=0.15, max_spacing=0.4,
142+
orientation=[0, -1, 0])
140143
sfs.plot.loudspeaker_2d(x0, n0, a0)
141144
plt.axis('equal')
142145
plt.xlabel('x / m')
@@ -149,7 +152,7 @@ def linear_random(N, min_spacing, max_spacing, center=[0, 0, 0],
149152

150153

151154
def circular(N, R, center=[0, 0, 0]):
152-
"""Get circular secondary source distribution parallel to the xy-plane.
155+
"""Return circular secondary source distribution parallel to the xy-plane.
153156
154157
Parameters
155158
----------
@@ -191,7 +194,7 @@ def circular(N, R, center=[0, 0, 0]):
191194

192195

193196
def rectangular(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
194-
"""Get rectangular secondary source distribution.
197+
"""Return rectangular secondary source distribution.
195198
196199
Parameters
197200
----------
@@ -239,7 +242,8 @@ def rectangular(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
239242

240243

241244
def rounded_edge(Nxy, Nr, dx, center=[0, 0, 0], orientation=[1, 0, 0]):
242-
"""Get secondary source distribution along the xy-axis with rounded edge at the origin.
245+
"""Return secondary source distribution along the xy-axis with rounded
246+
edge at the origin.
243247
244248
Parameters
245249
----------
@@ -313,7 +317,8 @@ def rounded_edge(Nxy, Nr, dx, center=[0, 0, 0], orientation=[1, 0, 0]):
313317

314318

315319
def edge(Nxy, dx, center=[0, 0, 0], orientation=[1, 0, 0]):
316-
"""Get secondary source distribution along the xy-axis with sharp edge at the origin.
320+
"""Return secondary source distribution along the xy-axis with sharp
321+
edge at the origin.
317322
318323
Parameters
319324
----------
@@ -365,7 +370,7 @@ def edge(Nxy, dx, center=[0, 0, 0], orientation=[1, 0, 0]):
365370

366371

367372
def planar(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
368-
"""Get planar secondary source distribtion.
373+
"""Return planar secondary source distribtion.
369374
370375
Parameters
371376
----------
@@ -389,7 +394,9 @@ def planar(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
389394
.. plot::
390395
:context: close-figs
391396
392-
x0, n0, a0 = sfs.array.planar((4,3), 0.5, center=[0, 0, 0], orientation=[0, 0, 1])
397+
x0, n0, a0 = sfs.array.planar(
398+
N=(4,3), spacing=0.5,
399+
center=[0, 0, 0], orientation=[0, 0, 1])
393400
sfs.plot.loudspeaker_2d(x0, n0, a0)
394401
plt.axis('equal')
395402
plt.xlabel('x / m')
@@ -409,7 +416,7 @@ def planar(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
409416

410417

411418
def cube(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
412-
"""Get cube-shaped secondary source distribtion.
419+
"""Return cube-shaped secondary source distribtion.
413420
414421
Parameters
415422
----------
@@ -433,7 +440,9 @@ def cube(N, spacing, center=[0, 0, 0], orientation=[1, 0, 0]):
433440
.. plot::
434441
:context: close-figs
435442
436-
x0, n0, a0 = sfs.array.cube(2, 0.5, center=[0, 0, 0], orientation=[1, 0, 0])
443+
x0, n0, a0 = sfs.array.cube(
444+
N=2, spacing=0.5,
445+
center=[0, 0, 0], orientation=[1, 0, 0])
437446
sfs.plot.loudspeaker_2d(x0, n0, a0)
438447
plt.axis('equal')
439448
plt.xlabel('x / m')
@@ -489,7 +498,10 @@ def sphere_load(file, radius, center=[0, 0, 0]):
489498
.. plot::
490499
:context: close-figs
491500
492-
x0, n0, a0 = sfs.array.sphere_load('../data/arrays/example_array_6LS_3D.txt', radius=2, center=[0, 0, 0])
501+
x0, n0, a0 = sfs.array.sphere_load(
502+
'../data/arrays/example_array_6LS_3D.txt',
503+
radius=2,
504+
center=[0, 0, 0])
493505
sfs.plot.loudspeaker_2d(x0, n0, a0, size=0.25)
494506
plt.axis('equal')
495507
plt.xlabel('x / m')
@@ -541,7 +553,8 @@ def load(file, center=[0, 0, 0], orientation=[1, 0, 0]):
541553
.. plot::
542554
:context: close-figs
543555
544-
x0, n0, a0 = sfs.array.load('../data/arrays/wfs_university_rostock_2018.csv')
556+
x0, n0, a0 = sfs.array.load(
557+
'../data/arrays/wfs_university_rostock_2018.csv')
545558
sfs.plot.loudspeaker_2d(x0, n0, a0)
546559
plt.axis('equal')
547560
plt.xlabel('x / m')
@@ -626,7 +639,8 @@ def concatenate(*arrays):
626639
Returns
627640
-------
628641
`ArrayData`
629-
Positions, orientations and weights of the concatenated secondary sources.
642+
Positions, orientations and weights
643+
of the concatenated secondary sources.
630644
631645
Examples
632646
--------

0 commit comments

Comments
 (0)