Skip to content

Commit 9104a32

Browse files
committed
Fixes to docstrings.
1 parent c61da8e commit 9104a32

2 files changed

Lines changed: 27 additions & 18 deletions

File tree

pompy/models.py

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def __init__(self, x, y, z, r_sq):
6161
class Rectangle(SlottedIterable):
6262
"""Axis-aligned rectangular region.
6363
64-
Rectangle is defined by two points (x_min, y_min) and (x_max, y_max) with
65-
it required that x_max > x_min and y_max > y_min.
64+
Rectangle is defined by two points `(x_min, y_min)` and `(x_max, y_max)`
65+
with it required that `x_max > x_min` and `y_max > y_min`.
6666
"""
6767

6868
__slots__ = ('x_min', 'x_max', 'y_min', 'y_max')
@@ -98,11 +98,11 @@ def h(self):
9898
return self.y_max - self.y_min
9999

100100
def contains(self, x, y):
101-
"""Whether (x, y) position is contained within this rectangle.
101+
"""Whether `(x, y)`` position is contained within this rectangle.
102102
103-
Tests whether the supplied position, an (x,y) pair, is contained within
104-
the region defined by this Rectangle object and returns True if so and
105-
False if not.
103+
Tests whether the supplied position, an `(x,y)` pair, is contained
104+
within the region defined by this `Rectangle` object and returns `True`
105+
if so and `False` if not.
106106
107107
Parameters
108108
----------
@@ -132,9 +132,9 @@ class PlumeModel(object):
132132

133133
def __init__(self, sim_region=None, source_pos=(5., 0., 0.),
134134
wind_model=None, model_z_disp=True, centre_rel_diff_scale=2.,
135-
puff_init_rad=0.001**0.5, puff_spread_rate=0.001,
135+
puff_init_rad=0.0316, puff_spread_rate=0.001,
136136
puff_release_rate=10, init_num_puffs=10, max_num_puffs=1000,
137-
rng=np.random):
137+
rng=None):
138138
"""
139139
Parameters
140140
----------
@@ -186,12 +186,15 @@ def __init__(self, sim_region=None, source_pos=(5., 0., 0.),
186186
will lead to breaks in puff release when the number of puffs
187187
remaining in the simulation region reaches the limit.
188188
rng : RandomState
189-
Random number generator to use in generating noise values. Defaults
190-
to `numpy.random` global generator however a seeded `RandomState`
191-
object can be passed if it is desired to have reproducible output.
189+
Random number generator to use in generating input noise. Defaults
190+
to `numpy.random` global generator if set to `None` however a
191+
seeded `RandomState` object can be passed if it is desired to have
192+
reproducible output.
192193
"""
193194
if sim_region is None:
194195
sim_region = Rectangle(0., 50., -12.5, 12.5)
196+
if rng is None:
197+
rng = np.random
195198
self.sim_region = sim_region
196199
if wind_model is None:
197200
wind_model = WindModel()
@@ -292,7 +295,7 @@ class WindModel(object):
292295
def __init__(self, sim_region=None, n_x=21, n_y=21, u_av=1., v_av=0.,
293296
k_x=20., k_y=20., noise_gain=2., noise_damp=0.1,
294297
noise_bandwidth=0.2, use_original_noise_updates=False,
295-
rng=np.random):
298+
rng=None):
296299
"""
297300
Parameters
298301
----------
@@ -330,11 +333,14 @@ def __init__(self, sim_region=None, n_x=21, n_y=21, u_av=1., v_av=0.,
330333
`ColouredNoiseGenerator` documentation.
331334
rng : RandomState
332335
Random number generator to use in generating input noise. Defaults
333-
to `numpy.random` global generator however a seeded `RandomState`
334-
object can be passed if it is desired to have reproducible output.
336+
to `numpy.random` global generator if set to `None` however a
337+
seeded `RandomState` object can be passed if it is desired to have
338+
reproducible output.
335339
"""
336340
if sim_region is None:
337341
sim_region = Rectangle(0, 100, -50, 50)
342+
if rng is None:
343+
rng = np.random
338344
self.sim_region = sim_region
339345
self.u_av = u_av
340346
self.v_av = v_av
@@ -529,7 +535,7 @@ class ColouredNoiseGenerator(object):
529535
"""
530536

531537
def __init__(self, init_state, damping=0.1, bandwidth=0.2, gain=1.,
532-
use_original_updates=False, rng=np.random):
538+
use_original_updates=False, rng=None):
533539
"""
534540
Parameters
535541
----------
@@ -550,12 +556,15 @@ def __init__(self, init_state, damping=0.1, bandwidth=0.2, gain=1.,
550556
Input gain of system, affects scaling of (noise) input.
551557
rng : RandomState
552558
Random number generator to use in generating input noise. Defaults
553-
to `numpy.random` global generator however a seeded `RandomState`
554-
object can be passed if it is desired to have reproducible output.
559+
to `numpy.random` global generator if set to `None` however a
560+
seeded `RandomState` object can be passed if it is desired to have
561+
reproducible output.
555562
use_original_updates : boolean
556563
Whether to use the original non-SDE based updates for the noise
557564
process as defined in Farrell et al. (2002), see above notes.
558565
"""
566+
if rng is None:
567+
rng = np.random
559568
# set up state space matrices
560569
self.a_mtx = np.array([
561570
[0., 1.], [-bandwidth**2, -2. * damping * bandwidth]])

pompy/processors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, puff_molecular_amount):
1717
"""
1818
Parameters
1919
----------
20-
puff_mol_amount : float
20+
puff_molecular_amount : float
2121
Molecular content of each puff (e.g. in moles or raw number of
2222
molecules). This is conserved as the puff is transported within
2323
the plume but the puff becomes increasingly diffuse as it's radius

0 commit comments

Comments
 (0)