-
Notifications
You must be signed in to change notification settings - Fork 14
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
Releaseable point cloud #24
Conversation
afd9bb0
to
7b3eb09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Only one comment.
6b1e370
to
d28a15a
Compare
Instead of transforming the point cloud directly to a numpy buffer, we should instead return a intermediate layer, since in the underlying C++ API point cloud exposes various functions such as width and height. Making buffer releasable also created some technical debt: assertNotReleased is needed since accessing the underlying a C++ object after it has been released causes a crash. Ignored flake8's D402, since it mistakenly thought that the paranthesis in the docstring was the signature of the function.
d28a15a
to
92d185e
Compare
Ready for next round. |
"""Release the underlying resources.""" | ||
self.__impl.release() | ||
|
||
def __enter__(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have a mixin or base class or something for these three functions. They are duplicated many places now.
You are just adding to the existing solution, so no need to fix in this PR. But if you agree please add an issue for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably be done through a decorator:
@utils.context_manager
class SomethingThatRequiresContextManager:
....
Will create an issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of transforming the point cloud directly to a numpy buffer, we
should instead return a intermediate layer, since in the underlying C++
API point cloud exposes various functions such as width and height.
Making buffer releasable also created some technical debt:
assertNotReleased is needed since accessing the underlying a C++ object
after it has been released causes a crash.