Skip to content

Conversation

@SwayamInSync
Copy link
Member

closes #204

@SwayamInSync
Copy link
Member Author

@seberg needed your opinion here
For errors like these (mentioned in #205 )

>>> from numpy_quaddtype import *
>>> QuadPrecision(1).imag
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[2], line 1
----> 1 QuadPrecision(1).imag

RuntimeError: Using legacy SETITEM with NULL array object is only supported for basic NumPy DTypes.

Will it be fine to approach these by setting the getters as tp_getset property (done in this PR)? or Ideally it should be integrated within Numpy's calling mechanism?

@seberg
Copy link
Member

seberg commented Oct 25, 2025

This makes sense, but for array support we need something more. I am interested in that too (soon), though. I suspect an ArrayMethod or even ufunc makes sense, but for ufunc need to add view support there (should be possible, but not sure it's worth it).

@SwayamInSync
Copy link
Member Author

Nice, yeah make sense, will be happy to extend this in NumPy whenever you feel right!

@SwayamInSync
Copy link
Member Author

Merging this in

@SwayamInSync SwayamInSync merged commit 650330a into numpy:main Oct 25, 2025
10 checks passed
@juntyr
Copy link
Contributor

juntyr commented Oct 25, 2025

Do we have tests for this?

@ngoldbaum
Copy link
Member

One thing that might help for ensuring new code has tests is to look at integrating coverage testing. That way you would have gotten a test failure here because the coverage went down.

@SwayamInSync
Copy link
Member Author

One thing that might help for ensuring new code has tests is to look at integrating coverage testing. That way you would have gotten a test failure here because the coverage went down.

I know coverage.py does something like this (never used it though) is that what you recommending?

@ngoldbaum
Copy link
Member

To get coverage of native code you need to use a native coverage tool like gcov or llvm-cov. But yeah, something like that. There's also codecov.io, which has some fancier features to display the results and add diagnostics to PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QuadPrecision(1).imag raises RuntimeError

4 participants