File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1214,22 +1214,26 @@ def save_inputs_to_json(self, json_file):
1214
1214
1215
1215
class SimpleInterface (BaseInterface ):
1216
1216
""" An interface pattern that allows outputs to be set in a dictionary
1217
+ called ``_results`` that is automatically interpreted by
1218
+ ``_list_outputs()`` to find the outputs.
1217
1219
1218
- When implementing `_run_interface`, set outputs with::
1220
+ When implementing `` _run_interface` `, set outputs with::
1219
1221
1220
1222
self._results[out_name] = out_value
1221
1223
1222
- This can be a way to upgrade a ``Function`` interface to do type checking:
1224
+ This can be a way to upgrade a ``Function`` interface to do type checking.
1223
1225
1226
+ Examples
1227
+ --------
1224
1228
>>> def double(x):
1225
1229
... return 2 * x
1226
-
1230
+ ...
1227
1231
>>> class DoubleInputSpec(BaseInterfaceInputSpec):
1228
1232
... x = traits.Float(mandatory=True)
1229
-
1233
+ ...
1230
1234
>>> class DoubleOutputSpec(TraitedSpec):
1231
1235
... doubled = traits.Float()
1232
-
1236
+ ...
1233
1237
>>> class Double(SimpleInterface):
1234
1238
... input_spec = DoubleInputSpec
1235
1239
... output_spec = DoubleOutputSpec
You can’t perform that action at this time.
0 commit comments