Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add method to set specific parameters on output object. #3328

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ def get_output(self, name: str) -> Any:
return self._outputs[name]
raise ValueError(f"Output {name} not found in {self.__class__.__name__}")

def set_on_output(self, name: str, **kwargs):
output = self.get_output(name)
for key, value in kwargs.items():
if not hasattr(output, key):
raise ValueError(f"Output {name} does not have a method {key}")
setattr(output, key, value)

def set_output_value(self, name: str, value: Any):
if name in self._outputs:
self._outputs[name].value = value
Expand Down
Loading