-
Notifications
You must be signed in to change notification settings - Fork 4
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
Avoid the use of stride tricks to make code more readable #89
Conversation
Yes, (almost) all functions in pylinalg are meant to also work on batches (i.e. arrays) of objects. That ability provides a big performance benefit in cases where multiple objects must be transformed. If the test for that is missing for this function, we should probably add that too, to make sure the changes don't break that ability. |
We can merge this if you just run ruff on the changes. |
??? locally it tells me there is nothing to change:
|
Git pull my commits and reinstall your full venv. I redid the whole packaging setup. (Merry Christmas!) |
still nothing. Merry Christmas! You know making the most of the time off ;) |
It's |
Admittedly this is a style issue, but I feel like stridetricks isn't very useful in this particular case and it somewhat destroys readability for me. While the reshaping is cute, I honestly don't think it helps much with the python overhead. I hit this code in trying to implment frustum culling for my application (though I still haven't succeeded in getting a performance improvement). Let me know what you think. I think there is also some complexity in the code due to an attempt at making it generaizable to beyond a single "aabb" object. However, I didn't see any tests for this, and so my presumption is that this is problem and likely the cause of much of the original code compelxity.
3e1cd6d
to
8ef2b65
Compare
took so much engineering time ^_^ |
maybe one day i'll be brave enough to use ruff format in my own projects! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the shiney new future man
Admittedly this is a style issue, but I feel like stridetricks isn't very useful in this particular case and it somewhat destroys readability for me.
While the reshaping is cute, I honestly don't think it helps much with the python overhead.
I hit this code in trying to implment frustum culling for my application (though I still haven't succeeded in getting a performance improvement).
Let me know what you think.
I think there is also some complexity in the code due to an attempt at making it generaizable to beyond a single "aabb" object.
However, I didn't see any tests for this, and so my presumption is that this is problem and likely the cause of much of the original code compelxity.