Skip to content
Snippets Groups Projects
Commit 4751e6cb authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Update AssignmentCollection.__repr__

`Assignment Collection for y[0,0,0]` is usually not very helpful.

New representation:

```
In [6]:     forward_assignments = pystencils.AssignmentCollection({
   ...:         z[0, 0]: x[0, 0] * sympy.log(x[0, 0] * y[0, 0]),
   ...:     y[0,0] : x[1,1] +1
   ...:             })

In [7]: forward_assignments
Out[7]: AssignmentCollection: z_C, y_C <- f(x_C, x_NE)
```
parent 00c00c45
1 merge request!110Update AssignmentCollection.__repr__
......@@ -345,8 +345,7 @@ class AssignmentCollection:
return result
def __repr__(self):
return "Assignment Collection for " + ",".join([str(eq.lhs) for eq in self.main_assignments
if isinstance(eq, Assignment)])
return f"AssignmentCollection: {str(tuple(self.defined_symbols))[1:-1]} <- f{tuple(self.free_symbols)}"
def __str__(self):
result = "Subexpressions:\n"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment