def kernelEngine( kernel, binding = "BoostPythonBinding" ): """render the c++ engine of the given kernel This factory method can only deal with kernels, but not scatterers. """ from bindings import classes as bindingClasses binding = bindingClasses() [ binding ] () from KernelComputationEngineFactory import KernelComputationEngineFactory factory = KernelComputationEngineFactory( binding ) from KernelComputationEngineRenderer import KernelComputationEngineRenderer return KernelComputationEngineRenderer( factory ).render( kernel )
def kernelEngine(kernel, binding="BoostPythonBinding"): """render the c++ engine of the given kernel This factory method can only deal with kernels, but not scatterers. """ from bindings import classes as bindingClasses binding = bindingClasses()[binding]() from KernelComputationEngineFactory import KernelComputationEngineFactory factory = KernelComputationEngineFactory(binding) from KernelComputationEngineRenderer import KernelComputationEngineRenderer return KernelComputationEngineRenderer(factory).render(kernel)
def shapeEngine(shape, binding="BoostPythonBinding", orientation_convention="McStasConvention"): "render the c++ engine of the given shape" from bindings import classes as bindingClasses bindingClass = bindingClasses()[binding] binding = bindingClass() from orientation_conventions import classes conventionClass = classes()[orientation_convention] orientation_convention = conventionClass() from ShapeComputationEngineFactory import ShapeComputationEngineFactory factory = ShapeComputationEngineFactory(binding, orientation_convention) from ShapeComputationEngineRenderer import ShapeComputationEngineRenderer return ShapeComputationEngineRenderer(factory).render(shape)
def shapeEngine( shape, binding = "BoostPythonBinding", orientation_convention = "McStasConvention" ): "render the c++ engine of the given shape" from bindings import classes as bindingClasses bindingClass = bindingClasses()[ binding ] binding = bindingClass() from orientation_conventions import classes conventionClass = classes()[ orientation_convention ] orientation_convention = conventionClass() from ShapeComputationEngineFactory import ShapeComputationEngineFactory factory = ShapeComputationEngineFactory( binding, orientation_convention ) from ShapeComputationEngineRenderer import ShapeComputationEngineRenderer return ShapeComputationEngineRenderer( factory ).render( shape )