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

rasterio 1.3 #512

Closed
emanuel-schmid opened this issue Jul 7, 2022 · 3 comments
Closed

rasterio 1.3 #512

emanuel-schmid opened this issue Jul 7, 2022 · 3 comments

Comments

@emanuel-schmid
Copy link
Collaborator

emanuel-schmid commented Jul 7, 2022

Action required for the update from rasterio 1.2.10 to 1.3.10

rasterio.crs.CRS

This is not a member anymore

changed way to deal with GMT_intermediate_coast_distance_01d.tif

The unit test climada.util.test.test_coordinates.TestGetGeodata.test_dist_to_coast_nasa fails with rasterio=1.3.0

Error Message

416.66666667 != 515.7736607600339 within 7 places (99.10699409003388 difference)

Stacktrace

Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/climada_branches/branches/develop/workspace/climada/util/test/test_coordinates.py", line 948, in test_dist_to_coast_nasa
    self.assertAlmostEqual(d, r)
AssertionError: 416.66666667 != 515.7736607600339 within 7 places (99.10699409003388 difference)

with rasterio=1.2.10, the test passes.

This can be reproduced

import numpy as np
from climada.util import read_raster_sample
path = '~/climada/data/GMT_intermediate_coast_distance_01d.tif'
lat, lon = [13.20833333, -12.497529], [-59.625, -58.849505]
print(read_raster_sample(path, np.array(lat), np.array(lon), intermediate_res=0.1))

up to rasterio 1.2.10, this used to print 416.666, with 1.3.10 515.773

@emanuel-schmid
Copy link
Collaborator Author

Which one is correct needs to be investigated. For the time being rasterio is limited to 1.2 in env_climada.yml

@emanuel-schmid
Copy link
Collaborator Author

More failing tests that have been fixed by downgrading to rasterio 1.2.10:

@emanuel-schmid emanuel-schmid changed the title Rasterio changed the way they deal with GMT_intermediate_coast_distance_01d.tif rasterio 1.3 Jul 7, 2022
@peanutfun
Copy link
Member

Resolved, apparently there was an underlying issue with the initial rasterio v1.3 release.

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

No branches or pull requests

2 participants