Skip to content

Commit 7782ee9

Browse files
committed
tidy up the repr output
1 parent e1eea4b commit 7782ee9

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

roboticstoolbox/robot/PoERobot.py

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@ def __str__(self):
3333
s += "]"
3434
return s
3535

36-
def _repr_pretty_(self, p, cycle):
37-
"""
38-
Pretty string for IPython (superclass method)
39-
40-
:param p: pretty printer handle (ignored)
41-
:param cycle: pretty printer flag (ignored)
42-
43-
"""
44-
# see https://ipython.org/ipython-doc/stable/api/generated/IPython.lib.pretty.html
45-
46-
p.text(f"{i}:\n{str(x)}")
47-
4836

4937
class PoERevolute(PoELink):
5038
def __init__(self, axis, point, **kwargs):
@@ -114,26 +102,14 @@ def __str__(self):
114102
return s
115103

116104
def __repr__(self):
117-
s = "PoERobot([\n "
118-
for j, link in enumerate(self):
119-
s += repr(link) + ","
120-
s += "],\n"
105+
s = "PoERobot([\n"
106+
s += "\n".join([" " + repr(link) + "," for link in self])
107+
s += "\n ],\n"
121108
s += f" T0=SE3({np.array_repr(self.T0.A)}),\n"
122-
s += f" name={self.name},\n"
109+
s += f" name=\"{self.name}\",\n"
123110
s += ")"
124111
return s
125112

126-
def _repr_pretty_(self, p, cycle):
127-
"""
128-
Pretty string for IPython (superclass method)
129-
130-
:param p: pretty printer handle (ignored)
131-
:param cycle: pretty printer flag (ignored)
132-
133-
"""
134-
# see https://ipython.org/ipython-doc/stable/api/generated/IPython.lib.pretty.html
135-
136-
p.text(f"{i}:\n{str(x)}")
137113

138114
def nbranches(self):
139115
return 0

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy