microsoft / gather

Spit shine for Jupyter notebooks 🧽✨
https://microsoft.github.io/gather
MIT License
532 stars 38 forks source link

Dependencies of lambda functions with >0 args are not gathered #21

Closed joyceerhl closed 5 years ago

joyceerhl commented 5 years ago

Describe the bug UPDATE: After experimenting further it seems that program slicing fails specifically on a lambda function which accepts at least 1 argument.

To Reproduce Steps to reproduce the behavior:

  1. Build and run Gather extension.
  2. Upload this notebook to Jupyter.
  3. Execute all cells.
  4. Try gathering the definitions and outputs for each case.

Expected Behavior Dependencies of lambda functions should be gathered.

Screenshots lambdas

andrewhead commented 5 years ago

Hey @joyceerhl! Thanks for pointing this out and the wonderful repro info. I found a small parsing inconsistency in the rules for parsing lambdas, which should be fixed in https://github.com/microsoft/gather/commit/60e050af4b3ccb403e68ebac3488eb8bf8f5564f

Want to try it out and see if works? Will require a jlpm run build:parser command to rebuild the parser. Here's what the fixed notebook looks like for me: image

joyceerhl commented 5 years ago

Works great! Thanks @andrewhead :-)