Commit 361e92a
committed
Update sym class hand written mthd type annotation
The handwritten methods of the sym classes all already accepted lists
(in addition to ndarrays) because they were backed by the autogenerated
functions, which support both. So, I updated the type annotations
accordingly.
Also, since the auto-generated methods already have adequeate error
messages, I removed the hand-written ones as they didn't cover certain
corner cases well (like 2d row vectors), and in order to make them
complete, they would just be duplicates of what was autogenerated more
or less anyway.
Also, fixed the type signature of the camera cal __init__ methods. This
should have been done previously, but was overlooked.
Also made a small fix to the corresponding jinja template's indenting to
match the style we use elsewhere.
Also changed the geo methods multiplication methods to accomadate
sequences. Since the Sequence abstract base class is located at
`collections.Sequence` in python2.7 and `collections.abc.Sequence` in
python3.8 and the like, I decided to instead identity a sequence by
whether or not it implements `__getitem__` and `__len__`.
Also check that it's not a `str`. Note, it seems that in python2.7 I
should really be checking not that it is a `str`, but rather a
`basestr`, but `basestr`s don't existing in python3.8. I didn't think
this corner case is that important, and if such cases are important,
then we should probably rethink our strategy here.
Also, all when multiplying a geo type by a sequence (so list, tuple, or
something like that) a column 2d ndarray is returned. The idea behind
this is that it's a bit more consistent and predictable (though, I'm
open to other return types).1 parent 93c689d commit 361e92a
File tree
14 files changed
+123
-182
lines changed- gen/python/sym
- symforce/codegen/backends/python/templates
- cam_package
- geo_package
- tests
- test
14 files changed
+123
-182
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments