Closed rrhg closed 1 month ago
Need advice on these issues:
find_inputs_and_outputs
.Apparently no one has ever use Soorgeon with a notebook with nested function definitions because it would throw an InputWontRunError for undefined name when calling the nested function. Example:
def fn():
def nested():
return global1
return nested()
Would throw an error: undefined name nested
. Apparently is a known limitation of pyflakes. In export.py, if we comment out the line pyflakes.check_notebook(self._nb)
, we don't get that error, but the code won't be checked by pyflakes.
Previously, we did not support using global variables inside a function's body:
The above would break since sum is using a variable that's defined outside the function's body. If a user tried to refactor a notebook with code like this using Soorgeon refactor, they would get an error message asking them to change the code to:
This PR automate this process and modify the user's source code on their behalf so they don't have to do it manually.
https://github.com/ploomber/soorgeon/issues/65
Closes #65
Checklist before requesting a review