mirror of
https://github.com/rasterio/rasterio.git
synced 2025-12-08 17:36:12 +00:00
New Env class and tests. More logging, tests, safer environment Remove usage (deprecated) of rasterio.drivers() Also pep8 cleanups throughout the tests and a fix for unchecked dtypes when opening a dataset in 'w' mode. Now we can simply import warnings in __init__.py. In the deprecations tests, we needed to see a single warning only one time to avoid multiple drivers() warnings. Add a global env. Add rasterio.env.setenv()
16 lines
332 B
Python
16 lines
332 B
Python
import logging
|
|
|
|
import rasterio
|
|
import rasterio.env
|
|
|
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
def test_band():
|
|
with rasterio.open('tests/data/RGB.byte.tif') as src:
|
|
b = rasterio.band(src, 1)
|
|
assert b.ds == src
|
|
assert b.bidx == 1
|
|
assert b.dtype in src.dtypes
|
|
assert b.shape == src.shape
|