-
Notifications
You must be signed in to change notification settings - Fork 74
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
Fixed pickling on SP #644
Fixed pickling on SP #644
Conversation
Now that I have something that works for pickling, I need to apply this to most of the other objects in the bindings. |
https://travis-ci.org/htm-community/htm.core/builds/574537849#L2368 Travis is still not happy |
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.
This looks good to me, thanks for demystifying the pybind11/pickle issue!
- Travis still chokes on the test
- guess this will be relevant for RDSE: serialization for py bindings #608
I typed in the name of the function incorrectly :-) |
@@ -38,15 +38,51 @@ def testCompute(self): | |||
self.assertTrue( active.getSum() > 0 ) | |||
|
|||
|
|||
@pytest.mark.skipif(sys.version_info < (3, 6), reason="Fails for python2 with segmentation fault") |
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.
isn't this still valid? (we don't test on py2, but someone still may run the repo on python2)
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.
Thank you, it's great to have a clean pickle serialization for python working!
@breznak when you have some time can you give this a review again. I want to point out that in bindings\py\tests\algorithms\temporal_memory_test.py, line 58 Funny how when we add more tests we seem to find more bugs. |
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.
Great to have py serialization for the big classes in order! 👍 And to have the new tests to verify.
Thanks a lot @dkeeney for the investigative work!!
|
||
|
||
@pytest.mark.skip(reason="Fails with rapidjson internal assertion -- indicates a bad serialization") | ||
def testNupicTemporalMemorySavingToString(self): |
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.
so, this is a new test, that fails - we think exposing an internal JSON/pybind bug. It's fine to skip in that case.
Can you file an issue with pybind11? Is there a newer release we could try?
Let's be sure our code is good first. I know that JSON is more sensitive to errors than the BINARY mode is. This will take some time to investigate.
I checked. They are still on 1.2.2 (Feb 2017) Nothing has changed in the master branch in 3 years. The error in JSON comes from rapidjson which is the third party parser. http://rapidjson.org/ |
hope we didn't switch to a dead project/ I'm happy with a mature, stable codebases, but nothing in 3yrs sounds suspicious |
I agree. The buggy part is the JSON encoder and until rapidjson does a new release Cereal cannot either. (Note that this is Cereal and not pybind11 we are talking about) |
I am still trying to understand how the build process works... |
I'm not sure what you mean, the CI are installed as "GH apps" and we have webhooks (all events allowed) which the CI react to: commit push, PR opened, etc. |
This PR fixes the pickling on SP and adds saveToFile( filename ) and loadFromFile(filename).
Response to Issue #641