@@ -125,12 +125,11 @@ def __init__(
125
125
126
126
# check all the incoming ELink objects
127
127
n = 0
128
- link_number = 0
129
- for link in links :
128
+ for k , link in enumerate (links ):
130
129
# if link has no name, give it one
131
130
if link .name is None :
132
- link .name = f"link-{ link_number } "
133
- link_number += 1
131
+ link .name = f"link-{ k } "
132
+ link . number = k
134
133
135
134
# put it in the link dictionary, check for duplicates
136
135
if link .name in self ._linkdict :
@@ -206,7 +205,7 @@ def __init__(
206
205
207
206
# assign the joint indices
208
207
if all ([link .jindex is None for link in links ]):
209
-
208
+ # no joints have an index
210
209
jindex = [0 ] # "mutable integer" hack
211
210
212
211
def visit_link (link , jindex ):
@@ -223,7 +222,7 @@ def visit_link(link, jindex):
223
222
self .base_link , lambda link : visit_link (link , jindex ))
224
223
225
224
elif all ([link .jindex is not None for link in links if link .isjoint ]):
226
- # jindex set on all, check they are unique and sequential
225
+ # jindex set on all, check they are unique and contiguous
227
226
if checkjindex :
228
227
jset = set (range (self ._n ))
229
228
for link in links :
@@ -285,7 +284,7 @@ def __str__(self):
285
284
Column ("parent" , headalign = "^" , colalign = "<" ),
286
285
Column ("ETS" , headalign = "^" , colalign = "<" ),
287
286
border = "thin" )
288
- for k , link in enumerate ( self ) :
287
+ for link in self :
289
288
color = "" if link .isjoint else "<<blue>>"
290
289
ee = "@" if link in self .ee_links else ""
291
290
ets = link .ets ()
@@ -305,7 +304,7 @@ def __str__(self):
305
304
else :
306
305
jname = ''
307
306
table .row (
308
- k ,
307
+ link . number ,
309
308
color + ee + link .name ,
310
309
jname ,
311
310
parent_name ,
0 commit comments