pysal / pointpats

Planar Point Pattern Analysis in PySAL
https://pysal.org/pointpats/
BSD 3-Clause "New" or "Revised" License
83 stars 26 forks source link

skyum raises NameError when numba not installed #81

Open wirrell opened 2 years ago

wirrell commented 2 years ago

Calling pointpaths.skyum raises NameError if the user does not have Numba installed. This is caused by a check for Numba in centrography.py on lines 402-405

try:
    from numba import njit, boolean

    HAS_NUMBA = True

which, if the numba import fails, leaves HAS_NUMBA undefined.

Suggested fix: define HAS_NUMBA = False in the except ModuleNotFoundError statement that begins on line 445.

ljwolf commented 2 years ago

Thanks! Will fix. I would also recommend pygeos.minimum_bounding_circle, which did not exist when this implementation of Skyum's algorithm was made!