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

Add dtype checker before shipping data to crand #197

Open
darribas opened this issue Jan 21, 2022 · 0 comments
Open

Add dtype checker before shipping data to crand #197

darribas opened this issue Jan 21, 2022 · 0 comments
Labels

Comments

@darribas
Copy link
Member

darribas commented Jan 21, 2022

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?

@darribas darribas added the bug label Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant