Open jenna-tomkinson opened 2 months ago
This is often a common practice for functional programming styles. Generally functions which return something are easier to test (we can test the output) whereas imperative functions (ones which do not return anything) must be sometimes implicitly tested. Functions which return values are also generally easier to compose together with one another, encouraging reuse and growth patterns. In addition, functions which return values generally are easier to think through as they tell us about modified states of variables or other data (instead of modifying state implicitly leaving us to guess about what happened).
For the existing functions which leverage subprocess we're already dealing with a bit of implied state (relying on the Python sub-process to tell us about what happened to the CellProfiler run - which itself only provides logs and no direct control through the API). I'd suggest limiting further implied states where we can and adding useful output so the work may better grow over time.
Consider returning something from this function - perhaps the logs or something which could be useful downstream. Doing this will help to chain together functionality here or where the function is implemented.
_Originally posted by @d33bs in https://github.com/WayScience/CP_Parallel/pull/1#discussion_r1736356420_