Utils
labridge.tools.utils
¶
labridge.tools.utils.create_schema_from_fn_or_method(name, func, additional_fields=None)
¶
Create schema from function.
Source code in labridge\tools\utils.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
|
labridge.tools.utils.get_extra_str_to_user(tool_logs)
¶
The log_to_user
and the value of the key references
in ToolLog will be presented to the user.
Source code in labridge\tools\utils.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
labridge.tools.utils.get_ref_file_paths(tool_logs)
¶
Source code in labridge\tools\utils.py
124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
labridge.tools.utils.pack_tool_output(tool_output, tool_log=None)
¶
Pack the tool output and tool log in a dict and dump to string.
PARAMETER | DESCRIPTION |
---|---|
tool_output |
The tool output string.
TYPE:
|
tool_log |
The tool log string.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
The dumped tool output and log. |
Source code in labridge\tools\utils.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
labridge.tools.utils.unpack_tool_output(tool_out_json)
¶
Unpack the tool output string and tool log string from
PARAMETER | DESCRIPTION |
---|---|
tool_out_json |
TYPE:
|
Source code in labridge\tools\utils.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
labridge.tools.utils.whether_abort_tool(tool_output)
¶
Whether a tool is aborted during execution.
PARAMETER | DESCRIPTION |
---|---|
tool_output |
The tool output of a tool.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Optional[bool]
|
Optional[bool]:
|
Source code in labridge\tools\utils.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|