Gradients updates, Incompressible Navier Stokes PDE#254
Gradients updates, Incompressible Navier Stokes PDE#254ktangsali merged 19 commits intoNVIDIA:mainfrom
Conversation
|
/blossom-ci |
There was a problem hiding this comment.
Looks good! The core of this PR (the PDE part) looks good.
There are some code quality changes to fix before merging, with repeated themes highlighted here:
- Builtin Type Hinting: Type hints should use builtin types since Python 3.10:
Listshould belist;Dictshould bedict, and so on. - Use "Sequence" More: I notice that we use a lot of type hints on input arguments that are
list. I suspect that for almost-all of these, we don't actually meanlist- we meanSequence, which can be imported fromtyping. This sounds like a minor difference, but it becomes an issue for end users when they give these arguments as, say tuples. All of a sudden, when they use an IDE with a modern static-type-checking language server (liketyvia VSCode/Cursor, or PyCharm's backend), they get type warning errors all over the place - this makes it hard for end users to distinguish what's an actual type mistake, and what is simply an overly-restrictive type hint. - String-Formatting: We should use f-strings where possible (i.e., almost-always), for readability.
- Comprehensions: list and dictionary comprehensions are not just more readable, but also more performant that direct loop+indexing in recent Python versions. We should use them where possible.
None of these individually are show-stoppers, but collectively I think there are enough of them to warrant fixing.
Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com>
Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com>
Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com>
Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com>
Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com>
Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com>
Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com>
Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com>
Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com>
Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com>
Thanks Peter for the review! I have addressed your feedback. Please have a look once more. |
peterdsharpe
left a comment
There was a problem hiding this comment.
Re-review complete! A few new items to fix; biggest one being a mutable default argument in a function.
peterdsharpe
left a comment
There was a problem hiding this comment.
Looking great! One last comment to fix, with another mutable default argument. Pre-emptively approving so that I'm not the bottleneck
|
/blossom-ci |
PhysicsNeMo Pull Request
Description
Updates to Least Squares gradients
Checklist
Dependencies