py-sphviewer
py-sphviewer copied to clipboard
Added kernel improvements and refactored files to be consistent
There were two copies of the kernel that, thankfully, were the same but were being re-defined in multiple places. This MR centralises the kernel definitions in a header (kind of sketchy, but better than the code re-use before and it avoids issues with building shared libraries within python).
My editor also auto-formatted the files I changed, let me know if you would like those specific changes reversed.
c_code.c wasn't used in the code, so that was safe. This means only one kernel was actually used. The file should be removed. Could you please revert the format changed to the code so that I can easily see what has actually changed? The same for your other requests. This doesn't mean that I am unhappy with considering improvement to the style, but this should be independent of the other changes, please.
I have reverted the changes in rendermodule.c but not in c_code.c as that's un-used anyway.
Note that here I've removed extra_code.c and re-wrote the contents of that entirely in sph_kernel.h.
Is there anything I can do to help this and the other PRs along?
Again, sorry for taking so long to review this. Thanks for this! I like to have a separate file to put all the kernels.
I do not understand, however, what are the kernel improvements here. Do you mean code structure?
From a kernel point of view, the default kernel hasn't changed. I don't think we should include the kernel number 4 as an option, as it is a weird combination of a 2D kernel that uses 3D smoothing lengths, and the two 3D piece-wise kernels shouldn't be used for making images unless properly integrated. I guess you copied them from extra_code.c?
So, out of 4 kernels, only the default one should stay in the file, unless you convince me of the opposite. Please let me know if I am missing something here.
I will include your suggested change of structure but I will leave only one kernel in that file.
I agree; I only kept the other kernels as they were already present in the file. Would you like me to remove them?