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

test_geographic_crop_with_resize failing locally #263

Closed
astrojuanlu opened this issue Jan 21, 2020 · 2 comments
Closed

test_geographic_crop_with_resize failing locally #263

astrojuanlu opened this issue Jan 21, 2020 · 2 comments

Comments

@astrojuanlu
Copy link
Contributor

Not sure what's going on:

$ pytest -s --lf
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.7.5, pytest-5.3.4, py-1.8.1, pluggy-0.13.1 -- /home/juanlu/.pyenv/versions/3.7.5/envs/telluric37/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/juanlu/Development/telluric/telluric, inifile: setup.cfg
plugins: cov-2.8.1
collected 43 items / 42 deselected / 1 selected                                                                                                                                              
run-last-failure: rerun previous 1 failure (skipped 119 files)

tests/test_georaster_tiling.py::GeoRasterCropTest::test_geographic_crop_with_resize FAILED

========================================================================================== FAILURES ==========================================================================================
_____________________________________________________________________ GeoRasterCropTest.test_geographic_crop_with_resize _____________________________________________________________________

self = <test_georaster_tiling.GeoRasterCropTest testMethod=test_geographic_crop_with_resize>

    def test_geographic_crop_with_resize(self):
        coords = mercantile.xy_bounds(*tiles[17])
        raster = self.read_only_virtual_geo_raster_wgs84()
        vector = GeoVector(Polygon.from_bounds(*coords), crs=WEB_MERCATOR_CRS)
        x_ex_res, y_ex_res = convert_resolution_from_meters_to_deg(
            self.metric_affine[6], MERCATOR_RESOLUTION_MAPPING[17])
>       cropped = raster.crop(vector, (x_ex_res, y_ex_res))

tests/test_georaster_tiling.py:388: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
telluric/georaster.py:1120: in crop
    masked=masked, bands=bands, resampling=resampling)
telluric/georaster.py:1194: in pixel_crop
    bands=bands, resampling=resampling)
telluric/georaster.py:1880: in get_window
    array = raster.read(bands, **read_params)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   TypeError: 'numpy.float64' object cannot be interpreted as an integer

rasterio/_io.pyx:332: TypeError

This is the output of pip freeze:

affine==2.3.0
alabaster==0.7.12
attrs==19.3.0
Babel==2.8.0
backcall==0.1.0
bleach==3.1.0
boltons==20.0.0
branca==0.3.1
certifi==2019.11.28
chardet==3.0.4
Click==7.0
click-plugins==1.1.1
cligj==0.5.0
coverage==5.0.3
cycler==0.10.0
decorator==4.4.1
defusedxml==0.6.0
docutils==0.16
dsnparse==0.1.15
entrypoints==0.3
Fiona==1.8.13
folium==0.10.1
idna==2.8
imageio==2.6.1
imagesize==1.2.0
importlib-metadata==1.4.0
ipykernel==5.1.3
ipyleaflet==0.12.1
ipython==7.11.1
ipython-genutils==0.2.0
ipywidgets==7.5.1
jedi==0.15.2
Jinja2==2.10.3
jsonschema==3.2.0
jupyter-client==5.3.4
jupyter-core==4.6.1
kiwisolver==1.1.0
lxml==4.4.2
MarkupSafe==1.1.1
matplotlib==3.1.2
mercantile==1.1.2
mistune==0.8.4
more-itertools==8.1.0
munch==2.5.0
mypy==0.761
mypy-extensions==0.4.3
nbconvert==5.6.1
nbformat==5.0.3
nbsphinx==0.5.0
notebook==6.0.2
numpy==1.18.1
packaging==20.0
pandas==0.25.3
pandocfilters==1.4.2
parso==0.5.2
pexpect==4.7.0
pickleshare==0.7.5
Pillow==7.0.0
pluggy==0.13.1
prometheus-client==0.7.1
prompt-toolkit==3.0.2
ptyprocess==0.6.0
py==1.8.1
pycodestyle==2.5.0
Pygments==2.5.2
pyparsing==2.4.6
pyproj==2.4.2.post1
pyrsistent==0.15.7
pytest==5.3.4
pytest-cov==2.8.1
python-dateutil==2.8.1
pytz==2019.3
pyzmq==18.1.1
rasterio==1.1.2
requests==2.22.0
Send2Trash==1.5.0
Shapely==1.6.4.post2
six==1.14.0
snowballstemmer==2.0.0
snuggs==1.4.7
Sphinx==2.3.1
sphinx-rtd-theme==0.4.3
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
terminado==0.8.3
testpath==0.4.4
tornado==6.0.3
traitlets==4.3.3
traittypes==0.2.1
typed-ast==1.4.1
typing-extensions==3.7.4.1
urllib3==1.25.7
wcwidth==0.1.8
webencodings==0.5.1
widgetsnbextension==3.5.1
xarray==0.14.1
zipp==2.0.0
@astrojuanlu
Copy link
Contributor Author

It seems that there's some sort of caching going on. However, it's been a while since I last ran these tests and it's not entirely clear to me how to reset it. Doing a rm -rf * && git restore . didn't work, but creating a new Python environment and a clean telluric clone did. It would be nice to have a clean command somewhere, whatever it has to do, or leverage temporary directories for the tests as much as possible.

@astrojuanlu
Copy link
Contributor Author

Cannot reproduce, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant