wlav / cppyy

Other
387 stars 39 forks source link

Updates to Eigen and ptr/reference support with ImplClassTypes and basic types #177

Closed maximusron closed 10 months ago

maximusron commented 12 months ago
maximusron commented 12 months ago

cc @vgvassilev, @sudo-panda , @wlav

maximusron commented 11 months ago

@wlav

This shouldn't live in the general numba_ext.py. Eigen-specific support is fine, but it should live in its own module that is only imported for folks interested in Eigen. This should be refactored by allowing the registration of hooks (similar to pythonizations or type mapping). As above, "Eigen" stuff should not live in the general module.

I was planning on going ahead by adding a module in cppyy/python with Eigen specific utils that registers the hooks when CppClass instances are detected as Eigen::~ proxies using the __cpp_name__. But instead of requiring users interested in Eigen to import the support module, wouldn't just a conditional import in the general extension work? That way any usage of var = cppyy.gbl.Eigen.~ in the user code, where var is passed in a numba njitted function, would automatically be handled while the general numba extension remains relatively clear of eigen specific code