-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Enable pickling for LLVMDouble class #213
Merged
+56
−5
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
221ccac
Enable pickling for LLVMDouble class
isuruf 43026f0
Bump symengine version
isuruf 93dd6c1
Fix failing test
isuruf 77efc63
Skip test if no llvm
isuruf 28247b9
Fix import error
isuruf 48bb041
Change load->_load
isuruf 3fdbe7b
Fix travis tests
isuruf 08226b9
Add osx_image
isuruf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from symengine import symbols, sin, sinh, have_numpy, have_llvm | ||
import pickle | ||
import unittest | ||
|
||
@unittest.skipUnless(have_llvm, "No LLVM support") | ||
@unittest.skipUnless(have_numpy, "Numpy not installed") | ||
def test_llvm_double(): | ||
import numpy as np | ||
from symengine import Lambdify | ||
args = x, y, z = symbols('x y z') | ||
expr = sin(sinh(x+y) + z) | ||
l = Lambdify(args, expr, cse=True, backend='llvm') | ||
ss = pickle.dumps(l) | ||
ll = pickle.loads(ss) | ||
inp = [1, 2, 3] | ||
assert np.allclose(l(inp), ll(inp)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2f5ff9db9ff511ee243438a85ea8e2da2d05af39 | ||
fff6755331226a08f0b14571bfbce2b23001d911 |
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.
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.
Actually I think the
_load
kwarg could go into__cinit__
if wecdef
the return value here:(untested)
cf. e.g. this
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.
I'm not sure I follow. Can you elaborate more? (Or a PR. 😃)
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.
It's not important (actually not sure it matters much), so let's leave it for now (and I can try to make a PR against master after this is merged if I can find a way to hide the _load kwarg).