-
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
cpp_template: Add Python mechanisms to pave way for C++ template binding. #7757
cpp_template: Add Python mechanisms to pave way for C++ template binding. #7757
Conversation
+@jadecastro for feature review, please (if it's not too much). Review status: 0 of 3 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
Checkpoint. Reviewed 2 of 3 files at r1. bindings/pydrake/util/cpp_template.py, line 9 at r1 (raw file):
BTW Should this be a TODO instead? bindings/pydrake/util/cpp_template.py, line 14 at r1 (raw file):
I was confused because I didn't initially understand that this was a stub. Needs a comment like the 7732 above. bindings/pydrake/util/cpp_template.py, line 25 at r1 (raw file):
FYI Meta I think the bindings/pydrake/util/cpp_template.py, line 25 at r1 (raw file):
This appears to be a public API (no leading bindings/pydrake/util/cpp_template.py, line 26 at r1 (raw file):
BTW Disallowed abbreviation. bindings/pydrake/util/cpp_template.py, line 37 at r1 (raw file):
FYI Should this base class ever be used directly at call sites, or is it merely convenient implementation reuse? If the latter, consider a rename to bindings/pydrake/util/cpp_template.py, line 56 at r1 (raw file):
I am not sure what this line means, given that bindings/pydrake/util/cpp_template.py, line 89 at r1 (raw file):
BTW Ah, I see what this is doing now. The default isn't a so much a default (that sticks around, and has a meaning on its own), its a special value that means "not yet set" ala C++ optional. Consider if a different name would help clarify. bindings/pydrake/util/cpp_template.py, line 95 at r1 (raw file):
BTW I don't understand why bindings/pydrake/util/cpp_template.py, line 117 at r1 (raw file):
Should this allow Comments from Reviewable |
Pass complete. Reviewed 3 of 3 files at r1. bindings/pydrake/util/cpp_template.py, line 122 at r1 (raw file):
BTW, I don't think this branch is checked in the unit tests? bindings/pydrake/util/cpp_template.py, line 138 at r1 (raw file):
BTW ("overrode by" -> "overridden by") bindings/pydrake/util/cpp_template.py, line 159 at r1 (raw file):
BTW, can this just derive directly from the Comments from Reviewable |
Review status: all files reviewed at latest revision, 14 unresolved discussions. bindings/pydrake/util/test/cpp_template_test.py, line 10 at r1 (raw file):
BTW, please label these "dummy" classes and functions here and below. Comments from Reviewable |
ecfd2d5
to
af9899c
Compare
Review status: 1 of 3 files reviewed at latest revision, 14 unresolved discussions. bindings/pydrake/util/cpp_template.py, line 9 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 14 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 25 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 25 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 26 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 37 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 56 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. Removed bindings/pydrake/util/cpp_template.py, line 89 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 95 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. Oops! From an old version. bindings/pydrake/util/cpp_template.py, line 117 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. Removed bindings/pydrake/util/cpp_template.py, line 122 at r1 (raw file): Previously, jadecastro (Jonathan DeCastro) wrote…
Done. Added. bindings/pydrake/util/cpp_template.py, line 138 at r1 (raw file): Previously, jadecastro (Jonathan DeCastro) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 159 at r1 (raw file): Previously, jadecastro (Jonathan DeCastro) wrote…
Done. bindings/pydrake/util/test/cpp_template_test.py, line 10 at r1 (raw file): Previously, jadecastro (Jonathan DeCastro) wrote…
Done. Comments from Reviewable |
af9899c
to
5ef0a2a
Compare
Reviewed 1 of 2 files at r2. bindings/pydrake/util/cpp_template.py, line 56 at r1 (raw file): Previously, EricCousineau-TRI wrote…
OK As it turns out, what I was missing here on first read is that in Python bindings/pydrake/util/cpp_template.py, line 23 at r2 (raw file):
BTW Annoying PEP-257 suggests that the Comments from Reviewable |
Reviewed 1 of 2 files at r2. bindings/pydrake/util/cpp_template.py, line 1 at r2 (raw file):
This doesn't have a bindings/pydrake/util/test/cpp_template_test.py, line 1 at r2 (raw file):
Python binaries compiled by Bazel should not have shebang lines. bindings/pydrake/util/test/cpp_template_test.py, line 40 at r2 (raw file):
Meta Some more template (confusing vs tuple) abbrevs here. Comments from Reviewable |
5ef0a2a
to
a7ce5b7
Compare
Review status: 1 of 3 files reviewed at latest revision, 5 unresolved discussions. bindings/pydrake/util/cpp_template.py, line 56 at r1 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 1 at r2 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/cpp_template.py, line 23 at r2 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/test/cpp_template_test.py, line 1 at r2 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. bindings/pydrake/util/test/cpp_template_test.py, line 40 at r2 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Done. I'd like to maintain a short suffix, as I'd like to use this with the systems framework. If you can think of another short convention (such as a trailing Default instantiation would be Comments from Reviewable |
Reviewed 2 of 2 files at r3. bindings/pydrake/util/test/cpp_template_test.py, line 40 at r2 (raw file): Previously, EricCousineau-TRI wrote…
I think for this unit test the Comments from Reviewable |
Review status: all files reviewed at latest revision, all discussions resolved. bindings/pydrake/util/test/cpp_template_test.py, line 40 at r2 (raw file): Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
OK Sounds good! Comments from Reviewable |
Reviewed 1 of 2 files at r3. Comments from Reviewable |
a7ce5b7
to
14a14ad
Compare
Note: Updated since #7732 was merged. Review status: 1 of 3 files reviewed at latest revision, all discussions resolved, some commit checks pending. Comments from Reviewable |
Reviewed 2 of 2 files at r4. Comments from Reviewable |
1 similar comment
Reviewed 2 of 2 files at r4. Comments from Reviewable |
Related to exposing templates in #7660.
Final PR is to combine with #7732 and incorporate C++ glue:
https://github.com/EricCousineau-TRI/repro/blob/fa4e6a0/python/bindings/pymodule/tpl/cpp_template.h#L45
This change is