Open3D-ML
Open3D-ML copied to clipboard
Consider to statically type functions and methods and use mypy to check types
Checklist
- [X] I have searched for similar issues.
- [X] I have tested with the latest development wheel.
- [X] I have checked the release documentation and the latest documentation (for
masterbranch).
Proposed new feature or change
Many functions in the code do not contain enough information about what kind of input and output is expected. This makes it's harder to use the methods as well as maintain the code.
For example, the run_inference method here has an argument data and return a dictionary with keys predict_labels and predict_scores. It is not obvious what is data from reading the docstring nor from reading the function signature. It is even more implicit that the output has a specific form.
Some other methods, like here, assume the dictionary has the key predict_labels without explicitly stating it.
References
https://realpython.com/python-type-checking/ https://docs.python.org/3/library/typing.html http://mypy-lang.org/
Additional information
No response