Open3D-ML icon indicating copy to clipboard operation
Open3D-ML copied to clipboard

Consider to statically type functions and methods and use mypy to check types

Open chingyulin opened this issue 3 years ago • 0 comments

Checklist

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

chingyulin avatar Mar 25 '22 14:03 chingyulin