Closed gillins closed 2 years ago
OK so I couldn't get this actually working. When calling jitclass
as a function (so we can vary the types of the attributes) I obtain a numba.experimental.jitclass.base.SegmentStats
object. However when used as a decorator I get a numba.experimental.jitclass.boxing.SegmentStats
object. Seems that the later can be used inside a @njit
function, but not the former and I have no idea how to convert between the two.
However, thinking about this a bit more I suspect these changes may be unnecessary. The SegmentStats
class is only used to calculate the stats in calcStatsForCompletedSegs
and isn't actually stored anywhere (?). Being able to calculate stats in [u]int64 is probably not of real value because the RAT columns are only int32 (and even if we update GDAL to cope with int64 columns that still isn't going to help with uint64 images). Maybe we should add a overflow check instead....
I am slightly worried about the SegmentStats.getStat()
function. Because it is a jitclass
the types should be fixed, but this function returns a different type depending on the statistic so not exactly sure it is doing the right thing ATM.
Closing for now, we can discuss later.
This should allow us to deal with 64 bit images (as added in gdal 3.5)
Note: currently untested