-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use same code style for inverse_distance_weighted.py and nearest_neighbor.py #924
Comments
I like this idea a lot, especially coming up with a condensed version of the reused functions. I can tackle this most likely this week. |
Thinking about this more, I don't know what code we could reuse as a function. Although similar, the nearest neighbor and inverse distance functions use completely different parameters for calculating things. So the things we could reuse would only save a few extra lines, and just add an extra file to the code base without too much reason. |
Thanks for looking at this. I was thinking of the similarity of lines 63-138 in Plus, there a lot of similarities in the function descriptions but one has argument type hints ( I found this comparison was easy using gvim -d or gvimdiff. |
Gotcha, yeah I can make a function out of those specific lines. I have a PR up, I'll tag you for a review once it's ready. |
Completed in PR #974 |
Under
uxarray.remap
,inverse_distance_weighted.py
andnearest_neighbor.py
have a lot of the same code but have different documentation style. Their formatting styles should probably be brought back into agreement.There is a lot of repeated code also. Perhaps that can be just in one place and reused.
I put in a pull request #923 for a neighborhood filter
apply_func
that started with the code in these functions as a template, so there was a lot of copying and pasting. If the shared code was in one place it could serve 3 different functions,inverse_distance_weighted.py
andnearest_neighbor.py
and the potential new functionapply_func
.The text was updated successfully, but these errors were encountered: