Register a ternary scalar function.
()
| 150 | |
| 151 | @pytest.fixture(scope="session") |
| 152 | def ternary_func_fixture(): |
| 153 | """ |
| 154 | Register a ternary scalar function. |
| 155 | """ |
| 156 | def ternary_function(ctx, m, x, c): |
| 157 | mx = pc.call_function("multiply", [m, x], |
| 158 | memory_pool=ctx.memory_pool) |
| 159 | return pc.call_function("add", [mx, c], |
| 160 | memory_pool=ctx.memory_pool) |
| 161 | ternary_doc = {"summary": "y=mx+c", |
| 162 | "description": "find y from y = mx + c"} |
| 163 | func_name = "y=mx+c" |
| 164 | pc.register_scalar_function(ternary_function, |
| 165 | func_name, |
| 166 | ternary_doc, |
| 167 | { |
| 168 | "array1": pa.int64(), |
| 169 | "array2": pa.int64(), |
| 170 | "array3": pa.int64(), |
| 171 | }, |
| 172 | pa.int64()) |
| 173 | return ternary_function, func_name |
| 174 | |
| 175 | |
| 176 | @pytest.fixture(scope="session") |
nothing calls this directly
no outgoing calls
no test coverage detected