Skip to content

Commit f7befaa

Browse files
evertrolbjlittle
authored andcommitted
Use raw strings to avoid invalid escape sequences (#36)
1 parent 6719608 commit f7befaa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

stratify/tests/test_bounded_vinterp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def test_mismatch_source_target_level_shape(self):
172172

173173
msg = ('Expecting the shape of the source and target levels except '
174174
'the axis of interpolation to be identical. '
175-
"\('-', 4, 2\) != \(2, 5, 2\)")
175+
r"\('-', 4, 2\) != \(2, 5, 2\)")
176176
with self.assertRaisesRegexp(ValueError, msg):
177177
bounded_vinterp.interpolate_conservative(target_bounds,
178178
source_bounds, data,
@@ -185,7 +185,7 @@ def test_mismatch_between_source_levels_source_data(self):
185185
data = np.zeros((3, 4))
186186

187187
msg = ('The provided data is not of compatible shape with the '
188-
"provided source bounds. \('-', 3, 4\) != \(2, 4\)")
188+
r"provided source bounds. \('-', 3, 4\) != \(2, 4\)")
189189
with self.assertRaisesRegexp(ValueError, msg):
190190
bounded_vinterp.interpolate_conservative(target_bounds,
191191
source_bounds, data,
@@ -198,7 +198,7 @@ def test_unexpected_bounds_shape(self):
198198
target_bounds = np.zeros((4, 4, 4))
199199
data = np.zeros((3, 4))
200200

201-
msg = 'Unexpected source and target bounds shape. shape\[-1\] != 2'
201+
msg = r'Unexpected source and target bounds shape. shape\[-1\] != 2'
202202
with self.assertRaisesRegexp(ValueError, msg):
203203
bounded_vinterp.interpolate_conservative(target_bounds,
204204
source_bounds, data,

stratify/tests/test_vinterp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def test_nd_inconsistent_shape(self):
379379
z_src = np.empty((3, 4, 5))
380380
fz_src = np.empty((2, 3, 4, 5))
381381
emsg = ('z_target and z_src have different shapes, '
382-
'got \(3, :, 6\) != \(3, :, 5\)')
382+
r'got \(3, :, 6\) != \(3, :, 5\)')
383383
with self.assertRaisesRegexp(ValueError, emsg):
384384
vinterp._Interpolation(z_target, z_src, fz_src, axis=2)
385385

0 commit comments

Comments
 (0)