Bindings interface issues
cmrlourenco opened this issue · 0 comments
Hi Tim,
The signature of method _cpp_image_visibilities (class CppKernelFuncs @ bindings/imager.py) has a couple of minor issues which we'd like you to address if possible.
kernel_oversampling argument
This argument uses a pythonic idiom (int or None) which doesn't go well with the binding code for the STP library.
I attempted to use the optional from C++17, which is experimental on GCC current, but it didn't map to anything useful on Python. Also, a simple int* wouldn't let me use int or None on the Python side, always forcing an int.
In order to avoid an unnecessary hack just to work around this specific parameter, would you be willing to split the parameter in two (flag + value)? Please note that this request is just for the bindings interface; the pipeline code doesn't need to be changed because we used std::optional.
An alternative approach would be using 0 to mean the same as None, if that's logical.
kernel_func_name argument
On the C++ side I'm using an enumeration which pybind11 nicely maps to a Python class with enum-like style. stp_python.KernelFunction.F, where F in {Gaussian, GaussianSinc, Sinc, TopHat, Triangle}.
Please use that instead of a string with the kernel name.
Thanks.