FEAT: Adding Support for scanfunc and fromstr ArrayFunc
#214
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a part of work, where making
numpy_quaddtypecompatible with NumPy's longdouble testsCopilot Summary
This pull request adds robust string and file parsing support for the quad-precision NumPy dtype, enabling users to reliably load and save quad-precision arrays using text-based methods such as
np.fromstringandnp.fromfile. The changes include new C implementations for parsing from strings and files, integration of these functions into the dtype definition, and comprehensive test suites to verify parsing accuracy and edge case handling.Quad-precision parsing functionality:
quadprec_scanfuncandquadprec_fromstrC functions to parse quad-precision values from files and strings for both Sleef and native backends (quaddtype/numpy_quaddtype/src/dtype.c).QuadPrecDType_Slots(quaddtype/numpy_quaddtype/src/dtype.c).<ctype.h>for whitespace handling in parsing routines (quaddtype/numpy_quaddtype/src/dtype.c).Testing and validation:
TestStringParsingandTestFileIOclasses with extensive tests for string and file parsing, covering simple values, high precision, scientific notation, negative values, separators, roundtrips, empty files, and edge cases (quaddtype/tests/test_quaddtype.py).