From 4751e6cb572477e7af2390f6bf4b16a3f87d95e8 Mon Sep 17 00:00:00 2001 From: Stephan Seitz <stephan.seitz@fau.de> Date: Tue, 17 Dec 2019 14:44:10 +0100 Subject: [PATCH] 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) ``` --- pystencils/simp/assignment_collection.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pystencils/simp/assignment_collection.py b/pystencils/simp/assignment_collection.py index e4827cdbc..d874965c1 100644 --- a/pystencils/simp/assignment_collection.py +++ b/pystencils/simp/assignment_collection.py @@ -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" -- GitLab