Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark tests that call GDAL binaries (#1555) #1557

Merged
merged 15 commits into from Nov 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions ISSUE_TEMPLATE.md
Expand Up @@ -11,10 +11,14 @@ often omit.
The primary forum for questions about installation and usage of Rasterio is
https://rasterio.groups.io/g/main. The authors and other users will answer
questions when they have expertise to share and time to explain. Please take the
time to craft a clear question and be patient about responses.

Please do not bring these questions to Rasterio's issue tracker, which we want
to reserve for bug reports and other actionable issues.
time to craft a clear question and be patient about responses. Please do not
bring these questions to Rasterio's issue tracker, which we want to reserve for
bug reports and other actionable issues.

Questions about development of Rasterio, brainstorming, requests for comment,
and not-yet-actionable proposals are welcome in the project's developers
discussion group https://rasterio.groups.io/g/dev. Issues opened in Rasterio's
GitHub repo which haven't been socialized there may be perfunctorily closed.

Please note: Rasterio contains extension modules and is thus susceptible to
C library compatibility issues. If you are reporting an installation or module
Expand Down
3 changes: 1 addition & 2 deletions README.rst
Expand Up @@ -195,8 +195,7 @@ Linux
Rasterio distributions are available from UbuntuGIS and Anaconda's conda-forge
channel.

`Manylinux1 <https://github.com/pypa/manylinux>`__ distributions may be
available in the future.
`Manylinux1 <https://github.com/pypa/manylinux>`__ wheels are available on PyPI.```

OS X
++++
Expand Down
3 changes: 2 additions & 1 deletion rasterio/plot.py
Expand Up @@ -155,7 +155,8 @@ def plotting_extent(source, transform=None):
Parameters
----------
source : array or dataset object opened in 'r' mode
input data
If array, data in the order rows, columns and optionally bands. If array
is band order (bands in the first dimension), use arr[0]
transform: Affine, required if source is array
Defines the affine transform if source is an array

Expand Down
1 change: 1 addition & 0 deletions tests/test_blocks.py
Expand Up @@ -112,6 +112,7 @@ def setUp(self):
def tearDown(self):
shutil.rmtree(self.tempdir)

@pytest.mark.gdalbin
def test_write_window(self):
name = os.path.join(self.tempdir, "test_write_window.tif")
a = np.ones((50, 50), dtype=rasterio.ubyte) * 127
Expand Down
1 change: 1 addition & 0 deletions tests/test_crs.py
Expand Up @@ -50,6 +50,7 @@ def test_read_epsg3857(tmpdir):


# Ensure that CRS sticks when we write a file.
@pytest.mark.gdalbin
def test_write_3857(tmpdir):
src_path = str(tmpdir.join('lol.tif'))
subprocess.call([
Expand Down
2 changes: 2 additions & 0 deletions tests/test_nodata.py
Expand Up @@ -8,6 +8,7 @@

logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)

@pytest.mark.gdalbin
def test_nodata(tmpdir):
dst_path = str(tmpdir.join('lol.tif'))
with rasterio.open('tests/data/RGB.byte.tif') as src:
Expand All @@ -24,6 +25,7 @@ def test_nodata(tmpdir):
pattern = b'Band 2.*?NoData Value=0'
assert re.search(pattern, info, re.DOTALL) is not None

@pytest.mark.gdalbin
def test_set_nodata(tmpdir):
dst_path = str(tmpdir.join('lol.tif'))
with rasterio.open('tests/data/RGB.byte.tif') as src:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_png.py
@@ -1,4 +1,5 @@
import logging
import pytest
import subprocess
import sys
import numpy as np
Expand All @@ -7,6 +8,7 @@
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)


@pytest.mark.gdalbin
def test_write_ubyte(tmpdir):
name = str(tmpdir.mkdir("sub").join("test_write_ubyte.png"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
Expand Down
1 change: 1 addition & 0 deletions tests/test_update.py
Expand Up @@ -11,6 +11,7 @@
from .conftest import requires_gdal21


@pytest.mark.gdalbin
def test_update_tags(data):
tiffname = str(data.join('RGB.byte.tif'))
with rasterio.open(tiffname, 'r+') as f:
Expand Down
13 changes: 12 additions & 1 deletion tests/test_write.py
Expand Up @@ -60,6 +60,7 @@ def test_no_crs(tmpdir):
dst.write(np.ones((100, 100), dtype=rasterio.uint8), indexes=1)


@pytest.mark.gdalbin
def test_context(tmpdir):
name = str(tmpdir.join("test_context.tif"))
with rasterio.open(
Expand Down Expand Up @@ -87,6 +88,7 @@ def test_context(tmpdir):
assert "Band 1 Block=100x81 Type=Byte, ColorInterp=Gray" in info


@pytest.mark.gdalbin
def test_write_ubyte(tmpdir):
name = str(tmpdir.mkdir("sub").join("test_write_ubyte.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
Expand All @@ -99,6 +101,7 @@ def test_write_ubyte(tmpdir):
assert "Minimum=127.000, Maximum=127.000, Mean=127.000, StdDev=0.000" in info


@pytest.mark.gdalbin
def test_write_ubyte_multi(tmpdir):
name = str(tmpdir.mkdir("sub").join("test_write_ubyte_multi.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
Expand All @@ -111,6 +114,7 @@ def test_write_ubyte_multi(tmpdir):
assert "Minimum=127.000, Maximum=127.000, Mean=127.000, StdDev=0.000" in info


@pytest.mark.gdalbin
def test_write_ubyte_multi_list(tmpdir):
name = str(tmpdir.mkdir("sub").join("test_write_ubyte_multi_list.tif"))
a = np.array([np.ones((100, 100), dtype=rasterio.ubyte) * 127])
Expand All @@ -123,6 +127,7 @@ def test_write_ubyte_multi_list(tmpdir):
assert "Minimum=127.000, Maximum=127.000, Mean=127.000, StdDev=0.000" in info


@pytest.mark.gdalbin
def test_write_ubyte_multi_3(tmpdir):
name = str(tmpdir.mkdir("sub").join("test_write_ubyte_multi_list.tif"))
arr = np.array(3 * [np.ones((100, 100), dtype=rasterio.ubyte) * 127])
Expand All @@ -135,6 +140,7 @@ def test_write_ubyte_multi_3(tmpdir):
assert "Minimum=127.000, Maximum=127.000, Mean=127.000, StdDev=0.000" in info


@pytest.mark.gdalbin
def test_write_float(tmpdir):
name = str(tmpdir.join("test_write_float.tif"))
a = np.ones((100, 100), dtype=rasterio.float32) * 42.0
Expand All @@ -149,6 +155,7 @@ def test_write_float(tmpdir):
assert "Minimum=42.000, Maximum=42.000, Mean=42.000, StdDev=0.000" in info


@pytest.mark.gdalbin
def test_write_crs_transform(tmpdir):
name = str(tmpdir.join("test_write_crs_transform.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
Expand All @@ -170,7 +177,7 @@ def test_write_crs_transform(tmpdir):
# (precision varies slightly by platform)
assert re.search(r'Pixel Size = \(300.03792\d+,-300.04178\d+\)', info)


@pytest.mark.gdalbin
def test_write_crs_transform_affine(tmpdir):
name = str(tmpdir.join("test_write_crs_transform.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
Expand All @@ -192,6 +199,7 @@ def test_write_crs_transform_affine(tmpdir):
assert re.search(r'Pixel Size = \(300.03792\d+,-300.04178\d+\)', info)


@pytest.mark.gdalbin
def test_write_crs_transform_2(tmpdir):
"""Using 'EPSG:32618' as CRS."""
name = str(tmpdir.join("test_write_crs_transform.tif"))
Expand All @@ -213,6 +221,7 @@ def test_write_crs_transform_2(tmpdir):
assert re.search(r'Pixel Size = \(300.03792\d+,-300.04178\d+\)', info)


@pytest.mark.gdalbin
def test_write_crs_transform_3(tmpdir):
"""Using WKT as CRS."""
name = str(tmpdir.join("test_write_crs_transform.tif"))
Expand All @@ -235,6 +244,7 @@ def test_write_crs_transform_3(tmpdir):
assert re.search(r'Pixel Size = \(300.03792\d+,-300.04178\d+\)', info)


@pytest.mark.gdalbin
def test_write_meta(tmpdir):
name = str(tmpdir.join("test_write_meta.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
Expand All @@ -245,6 +255,7 @@ def test_write_meta(tmpdir):
assert "Minimum=127.000, Maximum=127.000, Mean=127.000, StdDev=0.000" in info


@pytest.mark.gdalbin
def test_write_nodata(tmpdir):
name = str(tmpdir.join("test_write_nodata.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
Expand Down