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

Add support for SKIPPING cells' execution #141

Open
SagiPolaczek opened this issue Apr 14, 2022 · 3 comments
Open

Add support for SKIPPING cells' execution #141

SagiPolaczek opened this issue Apr 14, 2022 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@SagiPolaczek
Copy link

SagiPolaczek commented Apr 14, 2022

Hey,
First, great open source project.

I suggest the following feature:
Currently to execute the entire notebook we can do:

    def test_notebook(self):
        notebook_path = "fuse_examples/tutorials/hello_world/hello_world.ipynb"
        # Execute the whole notebook and save it as an object
        with testbook(notebook_path, execute=True, timeout=600) as tb:

Now, if we want to execute only the first cell, we shall do:

    def test_notebook(self):
        notebook_path = "fuse_examples/tutorials/hello_world/hello_world.ipynb"
        # Execute the whole notebook and save it as an object
        with testbook(notebook_path, execute=[0], timeout=600) as tb:

But what if we want to execute the entire notebook besides the first cell ???
Currently it has to be as follow:

    def test_notebook(self):
        NUM_OF_CELLS = 'some number'
        notebook_path = "fuse_examples/tutorials/hello_world/hello_world.ipynb"
        # Execute the whole notebook and save it as an object
        with testbook(notebook_path, execute=range(1, NUM_OF_CELLS + 1), timeout=600) as tb:

But A MUCH CLEANER APPROACH would be:

    def test_notebook(self):
        notebook_path = "fuse_examples/tutorials/hello_world/hello_world.ipynb"
        # Execute the whole notebook and save it as an object
        with testbook(notebook_path, skip=[0], timeout=600) as tb:
@SagiPolaczek SagiPolaczek changed the title Add support for unexecuting cells Add support for SKIPPING cells' execution Apr 14, 2022
@MSeal
Copy link
Member

MSeal commented Apr 15, 2022

That's a good idea to add and should be an easy change. If you have interest in opening a PR for it I can review quickly, otherwise I'll tag it for the next interested developer who has time to make it a reality :)

@MSeal MSeal added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Apr 15, 2022
@SagiPolaczek
Copy link
Author

That's a good idea to add and should be an easy change. If you have interest in opening a PR for it I can review quickly, otherwise I'll tag it for the next interested developer who has time to make it a reality :)

I'll try to do it in the next couple of days :)

@SagiPolaczek
Copy link
Author

@MSeal Any updates? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants