Skip to content

Commit

Permalink
REF: Remove unnecessary explicit kwargs from ChildEmulator.ask
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Jul 16, 2024
1 parent c5c0765 commit 3fe218f
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions octue/cloud/emulators/child.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,42 +41,14 @@ def received_events(self):
"""
return self.events

def ask(
self,
input_values=None,
input_manifest=None,
subscribe_to_logs=True,
allow_local_files=False,
handle_monitor_message=None,
record_events=True,
question_uuid=None,
parent_question_uuid=None,
originator_question_uuid=None,
originator=None,
push_endpoint=None,
asynchronous=False,
retry_count=0,
timeout=86400,
):
def ask(self, handle_monitor_message=None, record_events=True, **kwargs):
"""Ask the child emulator a question and receive its emulated response events. Unlike a real child, the input
values and manifest are not validated against the schema in the child's twine as it is only available to the
real child. Hence, the input values and manifest do not affect the events returned by the emulator.
:param any|None input_values: any input values for the question
:param octue.resources.manifest.Manifest|None input_manifest: an input manifest of any datasets needed for the question
:param bool subscribe_to_logs: if `True`, subscribe to logs from the child and handle them with the local log handlers
:param bool allow_local_files: if `True`, allow the input manifest to contain references to local files - this should only be set to `True` if the child will have access to these local files
:param callable|None handle_monitor_message: a function to handle monitor messages (e.g. send them to an endpoint for plotting or displaying) - this function should take a single JSON-compatible python primitive as an argument (note that this could be an array or object)
:param bool record_events: if `True`, record events received from the child in the `received_events` property
:param str|None question_uuid: the UUID to use for the question if a specific one is needed; a UUID is generated if not
:param str|None parent_question_uuid: the UUID of the question that triggered this question
:param str|None originator_question_uuid: the UUID of the question that triggered all ancestor questions of this question
:param str|None originator: the SRUID of the service revision that triggered all ancestor questions of this question
:param str|None push_endpoint: if answers to the question should be pushed to an endpoint, provide its URL here (the returned subscription will be a push subscription); if not, leave this as `None`
:param bool asynchronous: if `True`, don't create an answer subscription
:param int retry_count: the retry count of the question (this is zero if it's the first attempt at the question)
:param float timeout: time in seconds to wait for an answer before raising a timeout error
:raise TimeoutError: if the timeout is exceeded while waiting for an answer
:param kwargs: any number of keyword arguments that would normally be passed to `Child.ask`
:return dict, str: a dictionary containing the keys "output_values" and "output_manifest", and the question UUID
"""
event_replayer = EventReplayer(handle_monitor_message=handle_monitor_message, record_events=record_events)
Expand Down

0 comments on commit 3fe218f

Please sign in to comment.