@@ -207,7 +207,7 @@ def __init__(
207
207
if id is None :
208
208
# TODO: this could lead to duplicate ids and an error, but if
209
209
# setting random ids, this could also lead to undefined behavior
210
- id = f"{ CT_NAMESPACE } { self . __class__ .__name__ } "
210
+ id = f"{ CT_NAMESPACE } { type ( self ) .__name__ } "
211
211
elif not id .startswith (CT_NAMESPACE ):
212
212
id = f"{ CT_NAMESPACE } { id } "
213
213
MPComponent ._all_id_basenames .add (id )
@@ -228,7 +228,7 @@ def __init__(
228
228
# callbacks generated as final step by crystal_toolkit_layout()
229
229
self ._callbacks_to_generate .add (self )
230
230
231
- self .logger = logging .getLogger (self . __class__ .__name__ )
231
+ self .logger = logging .getLogger (type ( self ) .__name__ )
232
232
233
233
def id (
234
234
self ,
@@ -360,7 +360,7 @@ def all_ids(self) -> List[str]:
360
360
)
361
361
362
362
def __repr__ (self ):
363
- return f"{ self .id ()} <{ self . __class__ .__name__ } >"
363
+ return f"{ self .id ()} <{ type ( self ) .__name__ } >"
364
364
365
365
def __str__ (self ):
366
366
ids = "\n " .join (
@@ -371,7 +371,7 @@ def __str__(self):
371
371
[f"* { layout } " for layout in sorted (self ._sub_layouts .keys ())]
372
372
)
373
373
374
- return f"""{ self .id ()} <{ self . __class__ .__name__ } > \n
374
+ return f"""{ self .id ()} <{ type ( self ) .__name__ } > \n
375
375
IDs: \n { ids } \n
376
376
Stores: \n { stores } \n
377
377
Sub-layouts: \n { layouts } """
@@ -764,7 +764,7 @@ def reconstruct_kwargs_from_state(self, state=None, kwarg_labels=None) -> Dict:
764
764
kwargs [k ] = v .tolist ()
765
765
766
766
if SETTINGS .DEBUG_MODE :
767
- print (self . __class__ .__name__ , "kwargs" , kwargs )
767
+ print (type ( self ) .__name__ , "kwargs" , kwargs )
768
768
769
769
return kwargs
770
770
0 commit comments