8000 Dont use a context manager for np.load This isn't supported in numpy… · matplotlib/matplotlib@11b0a5a · GitHub
[go: up one dir, main page]

Skip to content

Commit 11b0a5a

Browse files
committed
Dont use a context manager for np.load This isn't supported in numpy 1.6.
1 parent 0f4a68d commit 11b0a5a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/matplotlib/tests/test_colors.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,14 @@ def gray_from_float_rgba():
237237
def test_light_source_topo_surface():
238238
"""Shades a DEM using different v.e.'s and blend modes."""
239239
fname = cbook.get_sample_data('jacksboro_fault_dem.npz', asfileobj=False)
240-
with np.load(fname) as dem:
241-
elev = dem['elevation']
242-
# Get the true cellsize in meters for accurate vertical exaggeration
243-
# Convert from decimal degrees to meters
244-
dx, dy = dem['dx'], dem['dy']
245-
dx = 111320.0 * dx * np.cos(dem['ymin'])
246-
dy = 111320.0 * dy
240+
dem = np.load(fname)
241+
elev = dem['elevation']
242+
# Get the true cellsize in meters for accurate vertical exaggeration
243+
# Convert from decimal degrees to meters
244+
dx, dy = dem['dx'], dem['dy']
245+
dx = 111320.0 * dx * np.cos(dem['ymin'])
246+
dy = 111320.0 * dy
247+
dem.close()
247248

248249
ls = mcolors.LightSource(315, 45)
249250
cmap = cm.gist_earth

0 commit comments

Comments
 (0)
0