11 from ctypes
import POINTER
12 from SQLamarr
import clib, c_TransformerPtr
13 from typing
import List
17 clib.new_GenerativePlugin.argtypes = (
28 clib.new_GenerativePlugin.restype = c_TransformerPtr
32 Wrapper to a compiled parametrization taking conditions and noise as input.
34 Python bindings for SQLamarr::GenerativePlugin.
48 Configure a `Transformer` to wrap a parametrization function defined
49 in an external library.
51 @param db: An open database connection;
52 @param library_path: path-like position of the shared library;
53 @param function_name: linker symbol of the function to wrap;
54 @param query: SQL query defining the reference indices and the inputs to
55 be passed to the wrapped function;
56 @param output_table: name of the output TEMPORARY TABLE where outputs are
57 stored toghether with the reference indices;
58 @param outputs: list of the output column names for further reference;
59 @param nRandom: number of normally distributed random noise values;
60 @param references: list of reference indices `SELECT`ed by the `query`,
61 but not part of the input to the wrapped function.
63 self.
_self_self = clib.new_GenerativePlugin(
65 library_path.encode(
'ascii'),
66 function_name.encode(
'ascii'),
67 query.encode(
'ascii'),
68 output_table.encode(
'ascii'),
69 ";".join(outputs).encode(
'ascii'),
71 ";".join(references).encode(
'ascii'),
75 """@private: Release the bound class instance"""
76 clib.del_Transformer(self.
_self_self)
79 def raw_pointer(self):
80 """@private: Return the raw pointer to the algorithm."""
81 return self.
_self_self
Wrapper to a compiled parametrization taking conditions and noise as input.
def __init__(self, SQLite3DB db, str library_path, str function_name, str query, str output_table, List[str] outputs, int nRandom, List[str] references)
Configure a Transformer to wrap a parametrization function defined in an external library.