Skip to content

Add dtype checker before shipping data to crand  #197

@darribas

Description

@darribas

Currently, we don't compare the dtype of objects being passed to the crand module, which is the conditional randomisation engine for many of the statistics in esda. This is important because, as it turns out, numba requires the same dtype for most operations, and this is very strict (e.g. float32 and float64 will not be compatible). This means that, if you're running a LISA and pass a W made up of float64 values and a pandas.Series with float32 values, Moran_Local will return an error because numba cannot get the product of the two.

One potential solution is adding a checker either a) at initialisation of all the statistics in esda that rely on crand, or b) within crand before any calculations happen (perhaps here). An open question is what that checker would do: 1) modify in place? 2) create a copy? 3) return an human-readable error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions