As a scientific computing practitioner, I usually write sequential code and debug it in Jupyter. Once I complete the target, I encapsulate the code into a function for parallel execution.
Therefore, I need to collect all necessary variables and write them to a parameters list, but it is easy to miss some parameters. So, I hope that tools (perhaps linting tools) can notify me if there are any references to global variables in the function.
Now, I copy the function code and imports to a new file in VSCode and wait for red wavy lines, which can be a bit troublesome.
In case someone wants to know more:
# Initially, I debug some calculation code
a = 1
b = 2
c = 3
result = a**b - c
# After completing them, I would collect the parameters.
from joblib import Parallel, delayed
def f(a: float, b: float):
# Oh, I forgot the `c`.
result = a**b - c
return result
Parallel(n_jobs=16)(delayed(f)(a, b) for a, b in zip(aa, bb))
# Then, c is always a constant value.
Thank you in advance