FIX: Allow promotion of Python abstract dtype + fill implementation#172
FIX: Allow promotion of Python abstract dtype + fill implementation#172SwayamInSync merged 4 commits intonumpy:mainfrom
Conversation
|
NOTE: Python Abstract types are also marked |
|
Could you provide a reference to the docs for the fill function? |
Its not same as the user facing Can expose the custom implementation using |
|
Can I get a review here @ngoldbaum @seberg |
|
Promotion logic looks good to me, filling logic also, but I don't know sleef. I think my review comment is: This should have some basic tests :). |
|
Cool, lets merge it in! |
closes numpy/numpy-quaddtype#21
Copilot Summary
This pull request enhances the quad-precision dtype implementation for NumPy by improving type compatibility and array filling functionality. The main changes include better handling of Python numeric types for dtype promotion and discovery, and the addition of a specialized fill function for generating arithmetic progressions in quad-precision arrays.
Improved dtype compatibility and type discovery:
common_dtypeto treat Python abstract dtypes (PyLongDType,PyFloatDType) as compatible with quad-precision, ensuring correct type promotion when mixing these types.quadprec_discover_descriptor_from_pyobjectto accept Pythonintandfloatobjects, returning a default quad-precision descriptor, and improved error handling for unsupported types.New array fill functionality:
quadprec_fillfunction to efficiently fill quad-precision arrays with arithmetic progressions, supporting both Sleef and long double backends.