You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am an avid user of Pythran for accelerating numerical computations in Python and have greatly benefited from its ability to optimize NumPy operations. I have a question regarding the support for custom NumPy dtypes in Pythran.
I often use custom dtypes in NumPy for more complex data structures and was wondering if there are any plans to support custom NumPy dtypes in Pythran. This feature would be particularly useful for [describe your use case].
Here's an example of how I use custom dtypes in NumPy:
importnumpyasnp# Example of a custom dtypecustom_dtype=np.dtype([('field1', np.float64), ('field2', np.int32)])
# Creating an array with the custom dtypearray=np.array([(1.0, 2), (3.0, 4)], dtype=custom_dtype)
The text was updated successfully, but these errors were encountered:
Hey @Ye980226 , from a typing point of view, it seems possible to build a custom dtype using pythran typing system. I am slightly less confident in the capability to convert that back to python mode (if you were to return that array), or to build generic field accessor (because you have a runtime value that would be part of the typing system).
I don't plan to support this any soon, it falls in the same category as user-defined classes, with an extra level of complexity and I like time (if not skill) to implement that in a proper way.
I am an avid user of Pythran for accelerating numerical computations in Python and have greatly benefited from its ability to optimize NumPy operations. I have a question regarding the support for custom NumPy dtypes in Pythran.
I often use custom dtypes in NumPy for more complex data structures and was wondering if there are any plans to support custom NumPy dtypes in Pythran. This feature would be particularly useful for [describe your use case].
Here's an example of how I use custom dtypes in NumPy:
The text was updated successfully, but these errors were encountered: