mirror of
https://github.com/rasterio/rasterio.git
synced 2025-12-08 17:36:12 +00:00
Refactored mpl.use('agg') from the tests __init__
replaced with a swap of plt.show with an empty lambda
This commit is contained in:
parent
e4f7ec8526
commit
2bd1bd9aed
@ -1,6 +0,0 @@
|
||||
#
|
||||
try:
|
||||
import matplotlib as mpl
|
||||
mpl.use('agg')
|
||||
except ImportError:
|
||||
pass
|
||||
@ -4,6 +4,13 @@ import sys
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
try:
|
||||
import matplotlib as mpl
|
||||
mpl.use('agg')
|
||||
import matplotlib.pyplot as plt
|
||||
except ImportError:
|
||||
plt = None
|
||||
|
||||
from affine import Affine
|
||||
import rasterio
|
||||
from rasterio.enums import MaskFlags
|
||||
|
||||
@ -15,6 +15,13 @@ from rasterio import (
|
||||
get_data_window, window_intersection, window_union, windows_intersect
|
||||
)
|
||||
|
||||
try:
|
||||
import matplotlib as mpl
|
||||
mpl.use('agg')
|
||||
import matplotlib.pyplot as plt
|
||||
plt.show = lambda :None
|
||||
except:
|
||||
pass
|
||||
|
||||
DATA_WINDOW = ((3, 5), (2, 6))
|
||||
|
||||
|
||||
@ -2,6 +2,12 @@ import numpy as np
|
||||
|
||||
import rasterio
|
||||
|
||||
try:
|
||||
import matplotlib as mpl
|
||||
mpl.use('agg')
|
||||
except:
|
||||
pass
|
||||
|
||||
def test_reshape():
|
||||
with rasterio.open('tests/data/RGB.byte.tif') as src:
|
||||
im_data = rasterio.plot.reshape_as_image(src.read())
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import numpy as np
|
||||
|
||||
try:
|
||||
import matplotlib as mpl
|
||||
mpl.use('agg')
|
||||
import matplotlib.pyplot as plt
|
||||
plt.show = lambda :None
|
||||
except ImportError:
|
||||
plt = None
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user