Skip to content

Commit 611eba6

Browse files
committed
misc: Fix typos in tests
1 parent 94be5e7 commit 611eba6

20 files changed

Lines changed: 56 additions & 50 deletions

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ arange = "arange"
104104
dorder = "dorder"
105105
# simpify - function in Devito for creating Sympy expressions
106106
simpify = "simpify"
107+
# vas - plural of va
108+
# Used in tests/test_gpu_common.py::TestStreaming::test_streaming_complete (TODO: FIX)
109+
vas = "vas"
110+
# tpe - Thread Pool Executor
111+
tpe = "tpe"
107112

108113
[tool.typos.default.extend-words]
109114
# datas - plural of data?
@@ -118,13 +123,14 @@ Sur = "Sur"
118123
# pointss - plural of points?
119124
# Horrendous use in operator/profiling (TODO: FIX)
120125
pointss = "pointss"
121-
# numer - common abbrevisation of numerator
126+
# numer - common abbreviation of numerator
122127
numer = "numer"
123128
# Yto - Very unfortunately appears in a short random binary string in a notebook
124129
Yto = "Yto"
125130
# ges - Random HTML identifier in examples/seismic/tutorials/17_fourier_mode
126131
ges = "ges"
127132

133+
128134
[tool.flake8]
129135
max-line-length = 90
130136
ignore = [

tests/test_adjoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_adjoint_F(self, mkey, shape, kernel, space_order, time_order, setup_fun
9292
"""
9393
Adjoint test for the forward modeling operator.
9494
The forward modeling operator F generates a shot record (measurements)
95-
from a source while the adjoint of F generates measurments at the source
95+
from a source while the adjoint of F generates measurements at the source
9696
location from data. This test uses the conventional dot test:
9797
< Fx, y> = <x, F^T y>
9898
"""

tests/test_caching.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ def test_symbol_aliasing_reverse(self):
561561
u.data[:] = 6.
562562
u_ref = weakref.ref(u.data)
563563

564-
# Create derivative and delete orignal u[x, y]
564+
# Create derivative and delete original u[x, y]
565565
dx = u.dx
566566
del u
567567
clear_cache()
@@ -682,7 +682,7 @@ def test_sparse_function(self, operate_on_empty_cache):
682682

683683
assert len(_SymbolCache) == cur_cache_size + ncreated
684684

685-
# No new symbolic obejcts are created
685+
# No new symbolic objects are created
686686
u.inject(expr=u, field=u)
687687
assert len(_SymbolCache) == cur_cache_size + ncreated
688688

tests/test_constant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TestConst:
1010

1111
def test_const_change(self):
1212
"""
13-
Test that Constand.data can be set as required.
13+
Test that Constant.data can be set as required.
1414
"""
1515

1616
n = 5

tests/test_dimension.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,16 +1482,16 @@ def test_stepping_dim_in_condition_lowering(self):
14821482
grid = Grid(shape=(4, 4))
14831483
_, y = grid.dimensions
14841484

1485-
ths = 10
1485+
threshold = 10
14861486
g = TimeFunction(name='g', grid=grid)
14871487

1488-
ci = ConditionalDimension(name='ci', parent=y, condition=Le(g, ths))
1488+
ci = ConditionalDimension(name='ci', parent=y, condition=Le(g, threshold))
14891489

14901490
op = Operator(Eq(g.forward, g + 1, implicit_dims=ci))
14911491

1492-
op.apply(time_M=ths+3)
1493-
assert np.all(g.data[0, :, :] == ths)
1494-
assert np.all(g.data[1, :, :] == ths + 1)
1492+
op.apply(time_M=threshold+3)
1493+
assert np.all(g.data[0, :, :] == threshold)
1494+
assert np.all(g.data[1, :, :] == threshold + 1)
14951495
assert 'if (g[t0][x + 1][y + 1] <= 10)\n'
14961496
'{\n g[t1][x + 1][y + 1] = g[t0][x + 1][y + 1] + 1' in str(op.ccode)
14971497

@@ -1809,24 +1809,24 @@ def test_issue_2007(self):
18091809
# proxy integral
18101810
f.data[:] = np.array(freq[:])
18111811
# Proxy Fourier integral holder
1812-
ure = Function(name="ure", grid=grid,
1812+
u_re = Function(name="u_re", grid=grid,
18131813
dimensions=(freq_dim,) + u.indices[1:],
18141814
shape=(nfreq,) + u.shape[1:])
18151815

18161816
# ConditionalDimension based on `f` to simulate bounds of Fourier integral
18171817
ct = ConditionalDimension(name="ct", parent=time, condition=Ge(time, f))
18181818
eqns = [
18191819
Eq(u.forward, u+1),
1820-
Eq(ure, ure + u, implicit_dims=ct)
1820+
Eq(u_re, u_re + u, implicit_dims=ct)
18211821
]
18221822

18231823
op = Operator(eqns)
18241824

18251825
op.apply(time_M=10)
18261826

1827-
assert np.all(ure.data[0] == 54)
1828-
assert np.all(ure.data[1] == 49)
1829-
assert np.all(ure.data[2] == 27)
1827+
assert np.all(u_re.data[0] == 54)
1828+
assert np.all(u_re.data[1] == 49)
1829+
assert np.all(u_re.data[2] == 27)
18301830

18311831
# Make sure the ConditionalDimension is at the right depth for performance
18321832
trees = retrieve_iteration_tree(op)

tests/test_dle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ def test_incs_no_atomic(self):
10101010
u = TimeFunction(name='u', grid=grid)
10111011
v = TimeFunction(name='v', grid=grid)
10121012

1013-
# Format: u(t, x, nastyness) += 1
1013+
# Format: u(t, x, nastiness) += 1
10141014
uf = u[t, x, f, z]
10151015

10161016
# All loops get collapsed, but the `y` and `z` loops are PARALLEL_IF_ATOMIC,

tests/test_dse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,7 +2609,7 @@ def test_premature_evalderiv_lowering(self):
26092609
# it behaves as if it were one
26102610
mock_custom_deriv = u.dx.dy.evaluate
26112611

2612-
# This symbolic operation -- creating an Add between an arbitray object
2612+
# This symbolic operation -- creating an Add between an arbitrary object
26132613
# and an EvalDerivative -- caused the EvalDerivative to be prematurely
26142614
# simplified being flatten into an Add
26152615
expr0 = u.dt - mock_custom_deriv
@@ -2745,7 +2745,7 @@ class TestTTI:
27452745

27462746
@cached_property
27472747
def model(self):
2748-
# TTI layered model for the tti test, no need for a smooth interace
2748+
# TTI layered model for the tti test, no need for a smooth interface
27492749
# bewtween the two layer as the compilation passes are tested, not the
27502750
# physical prettiness of the result -- which ultimately saves time
27512751
return demo_model('layers-tti', nlayers=3, nbl=10, space_order=8,

tests/test_fission.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def define(self, dimensions):
3939

4040
def test_nofission_as_unprofitable():
4141
"""
42-
Test there's no fission if no increase in number of collapsable loops.
42+
Test there's no fission if no increase in number of collapsible loops.
4343
"""
4444
grid = Grid(shape=(20, 20))
4545
x, y = grid.dimensions
@@ -79,7 +79,7 @@ def test_nofission_as_illegal():
7979

8080
def test_fission_partial():
8181
"""
82-
Test there's no fission if no increase in number of collapsable loops.
82+
Test there's no fission if no increase in number of collapsible loops.
8383
"""
8484
grid = Grid(shape=(20, 20))
8585
x, y = grid.dimensions

tests/test_gpu_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def test_visible_devices_with_devito_deviceid(self):
158158
def test_deviceid_per_rank(self, mode):
159159
"""
160160
Test that Device IDs set by the user on a per-rank basis do not
161-
get modifed.
161+
get modified.
162162
"""
163163
# Reversed order to ensure it is different to default
164164
user_set_deviceids = (1, 0)
@@ -1312,7 +1312,7 @@ def test_streaming_complete(self):
13121312

13131313
def test_streaming_split_noleak(self):
13141314
"""
1315-
Make sure the helper pthreads leak no memory in the target langauge runtime.
1315+
Make sure the helper pthreads leak no memory in the target language runtime.
13161316
"""
13171317
nt = 1000
13181318
grid = Grid(shape=(20, 20, 20))

tests/test_interpolation.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def test_precomputed_injection_time(r):
255255
])
256256
def test_interpolate(shape, coords, npoints=20):
257257
"""Test generic point interpolation testing the x-coordinate of an
258-
abitrary set of points going across the grid.
258+
arbitrary set of points going across the grid.
259259
"""
260260
a = unit_box(shape=shape)
261261
p = points(a.grid, coords, npoints=npoints)
@@ -274,7 +274,7 @@ def test_interpolate(shape, coords, npoints=20):
274274
])
275275
def test_interpolate_cumm(shape, coords, npoints=20):
276276
"""Test generic point interpolation testing the x-coordinate of an
277-
abitrary set of points going across the grid.
277+
arbitrary set of points going across the grid.
278278
"""
279279
a = unit_box(shape=shape)
280280
p = points(a.grid, coords, npoints=npoints)
@@ -295,7 +295,7 @@ def test_interpolate_cumm(shape, coords, npoints=20):
295295
])
296296
def test_interpolate_time_shift(shape, coords, npoints=20):
297297
"""Test generic point interpolation testing the x-coordinate of an
298-
abitrary set of points going across the grid.
298+
arbitrary set of points going across the grid.
299299
This test verifies the optional time shifting for SparseTimeFunctions
300300
"""
301301
a = unit_box_time(shape=shape)
@@ -334,7 +334,7 @@ def test_interpolate_time_shift(shape, coords, npoints=20):
334334
])
335335
def test_interpolate_array(shape, coords, npoints=20):
336336
"""Test generic point interpolation testing the x-coordinate of an
337-
abitrary set of points going across the grid.
337+
arbitrary set of points going across the grid.
338338
"""
339339
a = unit_box(shape=shape)
340340
p = points(a.grid, coords, npoints=npoints)
@@ -354,7 +354,7 @@ def test_interpolate_array(shape, coords, npoints=20):
354354
])
355355
def test_interpolate_custom(shape, coords, npoints=20):
356356
"""Test generic point interpolation testing the x-coordinate of an
357-
abitrary set of points going across the grid.
357+
arbitrary set of points going across the grid.
358358
"""
359359
a = unit_box(shape=shape)
360360
p = custom_points(a.grid, coords, npoints=npoints)
@@ -399,7 +399,7 @@ def test_interpolation_dx():
399399
])
400400
def test_interpolate_indexed(shape, coords, npoints=20):
401401
"""Test generic point interpolation testing the x-coordinate of an
402-
abitrary set of points going across the grid. Unlike other tests,
402+
arbitrary set of points going across the grid. Unlike other tests,
403403
here we interpolate an expression built using the indexed notation.
404404
"""
405405
a = unit_box(shape=shape)
@@ -476,7 +476,7 @@ def test_multi_inject(shape, coords, nexpr, result, npoints=19):
476476
])
477477
def test_inject_time_shift(shape, coords, result, npoints=19):
478478
"""Test generic point injection testing the x-coordinate of an
479-
abitrary set of points going across the grid.
479+
arbitrary set of points going across the grid.
480480
This test verifies the optional time shifting for SparseTimeFunctions
481481
"""
482482
a = unit_box_time(shape=shape)

0 commit comments

Comments
 (0)