update save method in pipeline
This commit is contained in:
@@ -33,11 +33,16 @@ class StatefulBaseClass:
|
||||
|
||||
return state
|
||||
|
||||
def show_config(self):
|
||||
def show_config(self, registered_objects=None):
|
||||
if registered_objects is None: # root call
|
||||
registered_objects = []
|
||||
|
||||
config = {}
|
||||
for key, value in self.__dict__.items():
|
||||
if isinstance(value, StatefulBaseClass):
|
||||
config[str(key)] = value.show_config()
|
||||
if isinstance(value, StatefulBaseClass) and value not in registered_objects:
|
||||
registered_objects.append(value)
|
||||
config[str(key)] = value.show_config(registered_objects)
|
||||
|
||||
else:
|
||||
config[str(key)] = str(value)
|
||||
return config
|
||||
|
||||
Reference in New Issue
Block a user