Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork15
FEAT: Adding pickle support to quaddtype#232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
SwayamInSync commentedNov 22, 2025
We might not need to use
Our |
SwayamInSync commentedNov 22, 2025
hash implementation might require some careful handlinghttps://github.com/python/cpython/blob/20b69aac0d19a5e5358362410d9710887762f0e7/Python/pyhash.c#L87 I'll do this in a different PR and then we can close the#231 |
jorenham left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
stub changes looks good to me
juntyr commentedNov 22, 2025
Why is the backend provided as an integer? A string literal might be a lot clearer, or if it has to be an int maybe we could add an int enum? |
SwayamInSync commentedNov 22, 2025
Internally |
jorenham commentedNov 22, 2025
I suppose you could do |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
SwayamInSync commentedNov 25, 2025
@ngoldbaum a gentle reminder here for review |
ngoldbaum commentedNov 25, 2025
@SwayamInSync I'd appreciate it if you could give me more than a couple of days - especially over a weekend - before pinging me on PR reviews. I had your PRs on my to-do list. |
ngoldbaum left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The C code and tests overall look good. I didn't review the tests in detail but I'm glad to see such extensive coverage of usages.
quaddtype/tests/test_quaddtype.py Outdated
| assertunpickled.flags.f_contiguous==original.flags.f_contiguous | ||
| @pytest.mark.parametrize("backend", ["sleef","longdouble"]) | ||
| deftest_pickle_reduce_method(self,backend): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
My only comment is that this test is a little too tightly coupled to the implementation to be useful.
You could, for example, decide to use__getnewargs__ instead of__reduce__ but then you'd have to update this test too.https://docs.python.org/3/library/pickle.html#object.__getnewargs__.
SwayamInSyncNov 25, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Right, I think I should just remove this test? as we already have tests which are just focussed on working of the pickle rather than implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yeah, I'm suggesting to delete the test.
SwayamInSync commentedNov 25, 2025
So sorry, I was working this weekend as well so slightly forgot the track of days :) |
SwayamInSync commentedNov 26, 2025
Merging this in |
f2a4bec intonumpy:mainUh oh!
There was an error while loading.Please reload this page.
This PR adds the pickle support as per#231
Usage:
Using
np.savez