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

Ability to only run / ignore specific cells #17

Open
amit1rrr opened this issue Dec 2, 2019 · 3 comments
Open

Ability to only run / ignore specific cells #17

amit1rrr opened this issue Dec 2, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@amit1rrr
Copy link
Member

amit1rrr commented Dec 2, 2019

Executing entire notebook is a "good" CI practice. But it's not always feasible or required (some cells can take hours to run). It would be good to offer an ability to only run specific cells or exclude specific cells. Which cells to run / ignore can be specified with tags.

This whole partial execution can be wrapped as a new treon cmdline flag (e.g. treon --partial). We'd still want the standard mode to execute complete notebooks top to bottom.

@amit1rrr amit1rrr added the enhancement New feature or request label Dec 2, 2019
@amit1rrr amit1rrr changed the title Ability to only run specific cells as part of the tests Ability to only run / ignore specific cells Dec 2, 2019
@merrcury
Copy link

Hi, I am trying to build this feature for quite some time. If You could answer some of the queries that will be helpful.

  • I came to know, backend/kernel does not know the ordering of cells, We have to mark each cell independently anyway. That will make this a thing of a frontend with tags and passing a subset of tags to treon --partial.
  • Another way around this can be I can publish a pip package containing some magic functions and using those magic functions we can run notebook partially(skipping cells). Later On, That pip package can be installed with treon as well. So, without treon --partial, We will be able to run notebook partially.
    What's your take on both thought process? & How personally think we can achieve this?

@amit1rrr
Copy link
Member Author

@merrcury Thanks for helping on this. Here's my thought process,

  • There needs to be a front end Jupyter extension to capture which cells to ignore. This can be a separate package (will be published to npm). You'll have to decide which Jupyter version to support (classic Jupyter or JupyterLab or both).

  • Whichever cells are tagged would have some metadata added to them e.g. "ignore": true

  • Once the above two are in place then we can implement treon --partial which would run all the cells except the ones marked with ignore tag.

Hope that helps think through this better.

@merrcury
Copy link

@amit1rrr Frontend Extensions seems to be the right path for the treon --partial.

For the jupyter version, I guess I'll want to add support for both versions as some online Notebooks like Azure Notebooks(supports jupyter extensions) is available in classic Jupyter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants