Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonas Plewinski
pystencils
Commits
c06f8b77
Commit
c06f8b77
authored
Aug 02, 2019
by
Stephan Seitz
Browse files
Implement Assignment.__hash__ for sympy <= 1.4
parent
d0dfb8bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/assignment.py
View file @
c06f8b77
...
...
@@ -49,6 +49,17 @@ else:
__str__
=
assignment_str
_print_Assignment
=
print_assignment_latex
# Apparently, in SymPy 1.4 Assignment.__hash__ is not implemented. This has been fixed in current master
try
:
sympy_version
=
sp
.
__version__
.
split
(
'.'
)
if
int
(
sympy_version
[
0
])
<=
1
and
int
(
sympy_version
[
1
])
<=
4
:
def
hash_fun
(
self
):
return
hash
((
self
.
lhs
,
self
.
rhs
))
Assignment
.
__hash__
=
hash_fun
except
Exception
:
pass
def
assignment_from_stencil
(
stencil_array
,
input_field
,
output_field
,
normalization_factor
=
None
,
order
=
'visual'
)
->
Assignment
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment