Skip to content

The compatibility between Numba and Python vectorization #202

@hongyuchen1030

Description

@hongyuchen1030

I noticed that for the helper function in uxarray/helpers.py, we are using the Numba, which, according to its documentation, prefer codes writing using "non python" styles (like loop) and lack supports for some features (like nested array)

Numba generates optimized machine code from pure Python code using the [LLVM compiler infrastructure](http://llvm.org/). With a few simple annotations, array-oriented and math-heavy Python code can be just-in-time optimized to performance similar as C, C++ and Fortran, without having to switch languages or Python interpreters.

However, at our upper levels like uxarray/grid.py, we are using the python vectorization to boost our performance: map functions, Ndarray manipulation, and so on, which seems like the opposite direction of the Numba.

I wonder if these two methods can be compatible with each other, in other words, will the mixing of these two styles slow down the performance?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginvalidThis doesn't seem right

    Type

    No type

    Projects

    Status

    ✅ Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions