File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ import json
2
+
3
+ from devtools import debug
4
+ from pydantic import validate_call
5
+
6
+ from fractal_tasks_core .dev .lib_args_schemas import (
7
+ create_schema_for_single_task ,
8
+ )
9
+
10
+
11
+ @validate_call
12
+ def task_function (arg_A : tuple [int , int ] = (1 , 1 )):
13
+ """
14
+ Short task description
15
+
16
+ Args:
17
+ arg_A: Description of arg_A.
18
+ """
19
+ pass
20
+
21
+
22
+ def test_tuple_argument ():
23
+ """
24
+ This test only asserts that `create_schema_for_single_task` runs
25
+ successfully. Its goal is also to offer a quick way to experiment
26
+ with new task arguments and play with the generated JSON Schema,
27
+ without re-building the whole fractal-tasks-core manifest.
28
+ """
29
+ schema = create_schema_for_single_task (
30
+ task_function = task_function ,
31
+ executable = __file__ ,
32
+ package = None ,
33
+ verbose = True ,
34
+ )
35
+ debug (schema )
36
+ print (json .dumps (schema , indent = 2 ))
You can’t perform that action at this time.
0 commit comments