Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement better dependency tracking for ipynb.fs.defs #11

Open
yuvipanda opened this issue Nov 8, 2016 · 4 comments
Open

Implement better dependency tracking for ipynb.fs.defs #11

yuvipanda opened this issue Nov 8, 2016 · 4 comments

Comments

@yuvipanda
Copy link
Collaborator

Right now, we only include assignments where the LHS is all caps. However, LHS all caps might have dependencies on RHS that's not all caps. These will not be evaluated, causing strange amounts of confusion.

Instead, we should attempt to track the dependencies on the RHS of such assignments, and eval those too (recursively). We should do this in such a way that the rules are very clear to explain to people.

This should still only be done for top level imports though.

@yuvipanda
Copy link
Collaborator Author

Hmm, can we get away with supporting only top-level things? What do we do with:

if a == 5:
    b = 6

C = b * 5

In this case I'll have to include all the the code, including the if (and the dependent a definition, wherever that comes from).

@yuvipanda
Copy link
Collaborator Author

And what do you do with:

if a == 5:
    b = 6
else:
    b = 9
    doSomethingReallyExpensiveWithLotsOfSideEffects()

C = b * 5

Do we strip out doSomethingReallyExpensiveWithLotsOfSideEffects() but leave b = 9? That seems like very unintuitive behavior.

@yuvipanda
Copy link
Collaborator Author

@ellisonbg suggested we use notebook tags, and I like that much better than magical solutions that involve AST munging or bytecode disassembly.

@parente
Copy link
Member

parente commented Nov 10, 2016

FWIW, we went down the same introspection path in https://github.com/jupyter-incubator/contentmanagement and instead backed off to using comment syntax as a stopgap tagging UI.

tonyfast added a commit to deathbeds/ipynb that referenced this issue Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants