You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -62,9 +65,12 @@ input values and/or an input manifest.
62
65
63
66
You can also set the following options when you call :mod:`Child.ask <octue.resources.child.Child.ask>`:
64
67
68
+
- ``children`` - If the child has children of its own (i.e. grandchildren of the parent), this optional argument can be used to override the child's "default" children. This allows you to specify particular versions of grandchildren to use (see :ref:`this subsection below <overriding_children>`).
65
69
- ``subscribe_to_logs`` - if true, the child will forward its logs to you
66
70
- ``allow_local_files`` - if true, local files/datasets are allowed in any input manifest you supply
67
71
- ``handle_monitor_message`` - if provided a function, it will be called on any monitor messages from the child
72
+
- ``record_messages_to`` – if given a path to a JSON file, messages received from the parent while it processes the question are saved to it
73
+
- ``allow_save_diagnostics_data_on_crash`` – if true, the input values and input manifest (including its datasets) will be saved by the child for future crash diagnostics if it fails while processing them
68
74
- ``question_uuid`` - if provided, the question will use this UUID instead of a generated one
69
75
- ``timeout`` - how long in seconds to wait for an answer (``None`` by default - i.e. don't time out)
70
76
@@ -78,7 +84,7 @@ sent back to the parent. If you're not sure how long a particular analysis might
78
84
79
85
80
86
Asking multiple questions in parallel
81
-
-------------------------------------
87
+
=====================================
82
88
You can also ask multiple questions to a service in parallel.
83
89
84
90
.. code-block:: python
@@ -98,7 +104,7 @@ This method uses threads, allowing all the questions to be asked at once instead
98
104
99
105
100
106
Asking a question within a service
101
-
----------------------------------
107
+
==================================
102
108
If you have :doc:`created your own Octue service <creating_services>` and want to ask children questions, you can do
103
109
this more easily than above. Children are accessible from the ``analysis`` object by the keys you give them in the
104
110
:ref:`app configuration <app_configuration>` file. For example, you can ask an ``elevation`` service a question like
@@ -154,3 +160,73 @@ See the parent service's `app configuration <https://github.com/octue/octue-sdk-
154
160
and `app.py file <https://github.com/octue/octue-sdk-python/blob/main/octue/templates/template-child-services/parent_service/app.py>`_
155
161
in the `child-services app template <https://github.com/octue/octue-sdk-python/tree/main/octue/templates/template-child-services>`_
156
162
to see this in action.
163
+
164
+
.. _overriding_children:
165
+
166
+
Overriding a child's children
167
+
=============================
168
+
If the child you're asking a question to has its own children (static children), you can override these by providing the
169
+
IDs of the children you want it to use (dynamic children) to the :mod:`Child.ask <octue.resources.child.Child.ask>`
170
+
method. Questions that would have gone to the static children will instead go to the dynamic children. Note that:
171
+
172
+
- You must provide the children in the same format as they're provided in the :ref:`app configuration <app_configuration>`
173
+
- If you override one static child, you must override others, too
174
+
- The dynamic children must have the same keys as the static children (so the child knows which service to ask which
175
+
questions)
176
+
- You should ensure the dynamic children you provide are compatible with and appropriate for questions from the child
177
+
service
178
+
179
+
For example, if the child requires these children in its app configuration:
0 commit comments