-
-
Notifications
You must be signed in to change notification settings - Fork 15
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
We might not need to use
Our |
|
hash implementation might require some careful handling https://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
|
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? |
Internally |
|
I suppose you could do |
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
|
@ngoldbaum a gentle reminder here for review |
|
@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
| assert unpickled.flags.f_contiguous == original.flags.f_contiguous | ||
|
|
||
| @pytest.mark.parametrize("backend", ["sleef", "longdouble"]) | ||
| def test_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__.
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.
So sorry, I was working this weekend as well so slightly forgot the track of days :) |
|
Merging this in |
This PR adds the pickle support as per #231
Usage:
Using
np.savez