(wip) convert variational to cython class