Open peanutfun opened 1 year ago
Sometimes it is useful to be able to create Centroids separately from the Hazard. But I would agree that we can remove the said methods. These operations can easily be done otherwise just from the __init__
.
Both methods have been deprecated with #721 and can be removed after the next release.
This had been reversed in the latest rewriting of the Centroids as geodataframe. I think it is still in general useful to have the possibility to create ones own centroids. For instance, when creating a tropical cyclone object with local storms, but on a standardized global set of centroids.
I would close this issue if this is fine with you @peanutfun .
@chahank This issue is about removing only from_geodataframe
and from_pix_bounds
. We already deprecated them. Do you now want to keep them in?
These methods are part of the centroids currently (and not deprecated). I think this is good like this. Centroids are now much slimmer and thus having a method to make centroids sound useful.
Would you insist on removing them? Then how would centroids be initialized?
To be clear, now there are 3 from_
methods:
from_exposures
: useful if the exposures is already defined to get a minimal hazardfrom_geodataframe
: useful if the geometries are already defined (avoids an extra array to geometry conversion)from_pnts_bounds
: useful to define a grid.
As far as I can see, nobody reads in Centroids on their own. Reading/creating centroids is always part of reading in Hazard data (...or is it?). Therefore, I see no reason why we should keep
from_
classmethods inCentroids
that are not used anywhere else. I compiled a list of these methods. The following classmethods are only called by tests, and not by any other code in either Climada Core or Petals:Can we remove them?