Skip to content
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

Add type information to functions, methods and classes #497

Open
paulojamorim opened this issue Jan 23, 2023 · 3 comments
Open

Add type information to functions, methods and classes #497

paulojamorim opened this issue Jan 23, 2023 · 3 comments

Comments

@paulojamorim
Copy link
Collaborator

paulojamorim commented Jan 23, 2023

Since python 3.5 it is possible to add type information to the parameters of functions, methods and classes. With this information it is possible to use tools like Mypy to catch calls made with the wrong type. This way you can avoid errors and make your code easier to maintain and grow.

References:

https://docs.python.org/3/library/typing.html
https://mypy-lang.org/"

@sudarsan2k5
Copy link

Cross posting #522 here for visibility.

Hi,

I interest to work on this project during the GSoC period. I have conducted some initial research on this topic and I am excited about the potential impact it could have on the InVesalius codebase. By adding type information, we can improve the code's readability, maintainability, and reduce the likelihood of errors. Additionally, the Github-CI action for catching type errors using tools like Mypy would make it easier to catch issues early on, before they become more difficult to debug.

To begin, I plan to first familiarize myself with the InVesalius codebase and the Python typing module. Next, I will create a list of functions, methods, and classes that require type annotations and add appropriate annotations to their parameters and return types.

Once the type information is added, I will create a Github-CI action to run MyPy on the codebase and catch any type errors. I will also ensure that the codebase adheres to best practices for typing, such as using Union types where appropriate and avoiding the use of "Any" types.

Please let me know if you have any feedback or suggestions on my proposed approach. Specifically, I would like to know if there are any specific resources, tools or libraries that I should focus on to help me get started.

Thank you so much for your time and I am looking forward to hearing back from you.

@paulojamorim
Copy link
Collaborator Author

Hi @sudarsan2k5 ,

Thanks for your interest! We will put the guidelines here (github) soon.

@xr-dev-saurabh
Copy link

Hi, I'm interested in this issue. Is it a priority or how should I move with issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants