Open atanikan opened 6 years ago
Hi @atanikan, thank you for the suggestion.
I'm a bit confused by what you mean by comments, though. In Python, it is advisable to use docstrings to describe what the class does instead of code comments. So, do you really want the code comments or just the docstrings would be enough? noWorkflow currently logs docstrings.
However, the current version of noWorkflow does not properly support classes. We are working on a new version that might suit you better. See the branch 2.0-alpha. Note that this version is in active development and may not support all python scripts. Additionally, it has a different data model. In this version, the docstring is an attribute of CodeBlock, which is a CodeComponent that represents a Script, a Class Definition, or a Function Definition.
CodeComponents have precise line and column attributes. You may use them to relate comment positions (extracted by another script - as we do not collect comments) to their respective classes and methods.
Please, let me know if you have any questions or if you find any bug in the branch 2.0-alpha
Hello Joao,
My apologies, yes I did mean docstrings. All comments wouldn't be necessary.
So if I understand you correctly in 2.0-alpha. , I can parse the log file (assuming there are multiple class files imported/called from a main.py file) and can extract the start of the flow of execution (with doc strings, file names and arguments) up to the output (with docstrings & file names)?
That's right! However, we didn't expand the collection beyond the main file yet. It is probably just a matter of calling the collect method in the import machinery, but it will require some filtering, and I'm a bit busy at this moment to try it. Feel free to try and submit a pull request.
Hello Developers,
As an enhancement request, I was wondering if it's possible for the metadata to log the class/method level comments within the python file? Class level comments can describe what the class does and the properties of the input arguments. I am trying to build a parser which can parse the log file and construct some sort of workflow with important descriptions as well.