Workflomics / pubmetric

Library for citation network based quality control of autogenerated workflows.
https://workflomics.readthedocs.io/en/latest/developer-guide/pubmetric.html
Apache License 2.0
1 stars 1 forks source link

Rework methods: break up large methods, return single data strucutre #9

Closed Ambivalentalfa closed 2 months ago

Ambivalentalfa commented 5 months ago

Break up methods into multiple methods to make them more readable: The method includes a lot of nesting, it would be good to keep that in mind, and potentially try to reduce the visual complexity. This often means breaking the method into multiple methods. For example, the code at line 113 after for tool in biotools_lst: #add tqdm here extracted as a method in src/WFQC/data.py

I see that you often return tuples, that is often hard to document and read, I would stick to 1 data structure per method when possible, we can maybe look together at one of the examples and try to improve it

2 methods named test_get_tool_metadata

vedran-kasalica commented 5 months ago

To add, sometimes it is better to return tuples, e.g., extract the first letter from a string (you could return (x,y), where x is the first letter and y is the rest of the string). However it should not be overused, and when used it should be documented. So it often depends on the use case, I will try to give some feedback on one of the next PRs, with fewer file changes.