Enable Fused Types in Cython with Carray
I love bcolz. It's so useful I made an extension for it (thanks to the bquery guys, for blazing that trail). Unfortunately, while I was making the extension I ran into a problem. Cython's method for doing templating (Fused Types) doesn't seem to be supported by bcolz.carray.
This is the hack that I created to get around that (note the third argument type_indicator):
https://github.com/pinleague/bdot/blob/master/bdot/carray_ext.pyx#L90
It uses numpy's support for fused types to solve the problem.
Thanks for all the hard work you've already done making such an awesome library. Adding this extra bit to carray would give extension writers an obvious solution to the templating problem and make extension writing a bit easier.
Here are some possibly helpful resources for anyone who wants to tackle the problem:
I'm not sure if the following will be of any help, but for templating in bquery in the end we used jinja templates, I guess you might have already seen, but just in case in bquery/templates you could see some functions of with this shape cpdef sum_{{ sum_type }} https://github.com/visualfabriq/bquery/blob/master/bquery/templates/ctable_ext.template.pyx#L387-L401 but in the end we also had to write some sort of if ..elif statement checking the type somewhere else.
Small update here: as of bquery PR #50, bquery also uses fused types.