-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
pydrake cpp_template: Add decorator for ease of defining instantiations #8666
pydrake cpp_template: Add decorator for ease of defining instantiations #8666
Conversation
+@avalenzu for feature review, please. Review status: 0 of 2 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
Reviewed 2 of 2 files at r1. Comments from Reviewable |
First pass complete. I don't think there's anything actually wrong here, just a couple of questions. Reviewed 2 of 2 files at r1. bindings/pydrake/util/cpp_template.py, line 160 at r1 (raw file):
BTW I don't know if this is an issue here or on bindings/pydrake/util/cpp_template.py, line 161 at r1 (raw file):
BTW Is it worth explaining that there's a convention that the name of the decorated function should be the bindings/pydrake/util/test/cpp_template_test.py, line 113 at r1 (raw file):
It seems confusing to me to use Comments from Reviewable |
3c11cff
to
3784ad2
Compare
Review status: 0 of 2 files reviewed at latest revision, 3 unresolved discussions. bindings/pydrake/util/cpp_template.py, line 160 at r1 (raw file): Previously, sammy-tri (Sam Creasey) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 161 at r1 (raw file): Previously, sammy-tri (Sam Creasey) wrote…
Done. Tried to clarify, sorry about that! bindings/pydrake/util/test/cpp_template_test.py, line 113 at r1 (raw file): Previously, sammy-tri (Sam Creasey) wrote…
Done. Comments from Reviewable |
Reviewed 2 of 2 files at r2. bindings/pydrake/util/cpp_template.py, line 161 at r1 (raw file): Previously, EricCousineau-TRI (Eric Cousineau) wrote…
way clearer now. Thanks! Comments from Reviewable |
Sorry to tack on one more thing, but in taking the scalar type conversion a little further, realized that the Syntactically, decorated functions can refer to them, since the variable will be injected into the function's However, for this usage, the function is used before the decorator returns, so the variable does not exist. Will quickly prototype the other solution and post it as a comparison. Review status: 0 of 2 files reviewed at latest revision, all discussions resolved, some commit checks pending. Comments from Reviewable |
Here's the alternative: I'm game for either, as they're just sugar. Can I ask if either you have a preference? Review status: 0 of 2 files reviewed at latest revision, all discussions resolved, some commit checks pending. Comments from Reviewable |
(Another alternative is to defer evaluation of instantiations using a queue until requested, which shouldn't be too hard.) Comments from Reviewable |
I think I'm fine with this implementation if you are. Reviewed 2 of 2 files at r3. bindings/pydrake/util/cpp_template.py, line 182 at r3 (raw file):
BTW I think this needs to be updated to match the change to Comments from Reviewable |
1ac95e4
to
33406cc
Compare
OK Sounds good! Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion. bindings/pydrake/util/cpp_template.py, line 182 at r3 (raw file): Previously, sammy-tri (Sam Creasey) wrote…
Done. Comments from Reviewable |
Reviewed 2 of 2 files at r4. Comments from Reviewable |
Towards defining user classes with scalar type conversion, etc, in parallel with #8665.
\cc @gizatt @RussTedrake
This change is