You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Potential to add something as return for CP Parallel function #4
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.
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.
Activity
d33bs commentedon Aug 30, 2024
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.