Merged
Conversation
timhoffm
approved these changes
Dec 19, 2018
jklymak
reviewed
Dec 22, 2018
| for n in normals]) | ||
| with np.errstate(invalid="ignore"): | ||
| shade = ((normals / np.linalg.norm(normals, axis=1, keepdims=True)) | ||
| @ lightsource.direction) |
Member
There was a problem hiding this comment.
OK, I couldn't even google this one. What does the @ operator do?
Member
There was a problem hiding this comment.
That‘s a new operator introduced in python 3. Numpy uses it for matrix multiplication. a @ b is the same as np.dot(a, b), just more readable.
Member
|
xref #13030 |
Contributor
Author
|
I can rebase this on top of #13030 once it is merged, no problem. |
tacaswell
previously requested changes
Dec 24, 2018
Member
tacaswell
left a comment
There was a problem hiding this comment.
Blocking only to make sure @WeatherGod has a chance to look at this.
@WeatherGod should dismiss this.
WeatherGod
approved these changes
Feb 6, 2019
Member
Member
|
@anntzer agreed to wait, above. |
Having a function named mod that doesn't do % but computes the norm of a vector is just a good way to trip the reader (yes, I know about the term "modulus of a vector", but still). Also vectorize a normals calculation. Also we can use % instead of np.mod elsewhere.
Contributor
Author
|
rebased and removed the deprecation notice, as #13030 already takes care of that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Having a function named mod that doesn't do % but computes the norm of a
vector is just a good way to trip the reader (yes, I know about the term
"modulus of a vector", but still).
Also vectorize a normals calculation.
Also we can use % instead of np.mod elsewhere.
PR Summary
PR Checklist