Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Bindgen
pystencils
Commits
c06f8b77
Commit
c06f8b77
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Implement Assignment.__hash__ for sympy <= 1.4
parent
d0dfb8bd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/assignment.py
+11
-0
11 additions, 0 deletions
pystencils/assignment.py
with
11 additions
and
0 deletions
pystencils/assignment.py
+
11
−
0
View file @
c06f8b77
...
@@ -49,6 +49,17 @@ else:
...
@@ -49,6 +49,17 @@ else:
__str__
=
assignment_str
__str__
=
assignment_str
_print_Assignment
=
print_assignment_latex
_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
,
def
assignment_from_stencil
(
stencil_array
,
input_field
,
output_field
,
normalization_factor
=
None
,
order
=
'
visual
'
)
->
Assignment
:
normalization_factor
=
None
,
order
=
'
visual
'
)
->
Assignment
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment