Open ThomasRoosli opened 1 month ago
Indeed. During the refactoring of Centroids
, many methods have been removed, see https://github.com/CLIMADA-project/climada_python/blob/develop/CHANGELOG.md#removed
We tried to deprecate methods that should not be used anymore, and immediately removed methods that have no use anymore. However, for methods like set_geometry_points
we could indeed retain a stub that does nothing and issues a deprecation warning. We will go through this again and update Centroids
accordingly.
Indeed, the next release will be a major, breaking release for these reasons.
Methods for which we could provide deprecation warnings:
Method to deprecate | Action it takes |
---|---|
Hazard.clear | creates new, empty hazard |
Centroids.check | nothing |
Centroids.clear | clears GDF |
Centroids.read_hdf5 | Calls read_hdf5 on GDF |
Centroids.set_elevation | nothing |
Centroids.set_geometry_points | nothing |
Centroids.set_lat_lon | nothing |
@chahank
Centroids.calc_pixels_polygons
is used in #857 and might need to be re-introduced.
Looking at the proposed changes in #587 I fail to see why this method would actually be needed. My understanding is that #857 is trying to use the now-refactored and deprecated raster and pixel logic. But I do not see why this would be necessary for achieving the goal of #857 which to allow the computation, visualization and storage of local frequency exceedance intensities of hazards. So, we might first try to bring #857 up to date with the refactored centroids, and then see whether Centroids.calc_pixels_polygons
is needed.
Problem: I wanted to rerun a previously working code (e.g. on the current main branch) using the develop branch and it suddenly failed.
Possible solution: Have you considered keeping an "empty"
set_geometry_points
method instead of just removing it and issuing a deprecated warning informing the user that this function is now useless? The code would run through smoothly and the result would be correct because now the geometry is already correctly set automatically...Alternative solution: I assume the next release would be a major release, so maybe keeping such functionality is not important?