anyoptimization / pymoo

NSGA2, NSGA3, R-NSGA3, MOEAD, Genetic Algorithms (GA), Differential Evolution (DE), CMAES, PSO
https://pymoo.org
Apache License 2.0
2.31k stars 399 forks source link

Missing TypeHints and DocStrings across the code base #419

Closed Resethel closed 1 year ago

Resethel commented 1 year ago

At the moment, it is somewhat non-trivial to understand how the code structures, and how the types flow through the code. Many classes and functions are missing docstrings clarifying their intent or the type of the inner variables, and there are almost no TypeHints across the code base.

TypeHints (see PEP484) make it easier to read and understand code (by default the "type" of objects in Python is dynamically determined and can change, adding TypeHints clarifies intent). Newer code that has been developed usually includes TypeHints.

I'd suggest using a tool such as MonkeyType to help with that process.

blankjul commented 1 year ago

Very good point. Mostly because the framework has historically not started with type hints. But I agree no reason to not start doing it. Also, let me know if you want to support us and join our team.

Resethel commented 1 year ago

I see! I'd gladly help out and join the team. I can work on a PR for this issue :)

blankjul commented 1 year ago

Looking forward to your PR!

gptlang commented 2 months ago

Are there any updates? It's still quite painful working with pymoo due to the lack of types.