How to use the @jupyterlab/notebook.NotebookActions.runAndAdvance function in @jupyterlab/notebook

To help you get started, we’ve selected a few @jupyterlab/notebook examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / tests / test-notebook / src / actions.spec.ts View on Github external
it('should run the selected cells ', async () => {
        const next = widget.widgets[1] as MarkdownCell;
        widget.select(next);
        const cell = widget.activeCell as CodeCell;
        cell.model.outputs.clear();
        next.rendered = false;
        const result = await NotebookActions.runAndAdvance(widget, session);
        expect(result).to.equal(true);
        expect(cell.model.outputs.length).to.be.above(0);
        expect(next.rendered).to.equal(true);
      }).timeout(30000); // Allow for slower CI
github jupyterlab / jupyterlab / tests / test-notebook / src / actions.spec.ts View on Github external
it('should stop executing code cells on an error', async () => {
        widget.activeCell.model.value.text = ERROR_INPUT;
        const cell = widget.model.contentFactory.createCodeCell({});
        widget.model.cells.push(cell);
        widget.select(widget.widgets[widget.widgets.length - 1]);
        const result = await NotebookActions.runAndAdvance(widget, ipySession);
        expect(result).to.equal(false);
        expect(cell.executionCount).to.be.null;
        await ipySession.kernel.restart();
      }).timeout(30000); // Allow for slower CI
github jupyterlab / jupyterlab-data-explorer / jupyterlab / examples / notebook / src / commands.ts View on Github external
execute: () => {
      NotebookActions.runAndAdvance(nbWidget.content, nbWidget.context.session);
    }
  });
github jwkvam / jupyterlab-vim / src / index.ts View on Github external
execute: args => {
                const current = getCurrent(args);

                if (current) {
                    const { context, content } = current;
                    NotebookActions.runAndAdvance(content, context.session);
                    current.content.mode = 'edit';
                }
            },
            isEnabled
github jupyterlab / jupyterlab / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

      if (current) {
        const { context, notebook } = current;

        return NotebookActions.runAndAdvance(notebook, context.session);
      }
    },
    isEnabled
github jupyterlab / jupyterlab / examples / notebook / src / commands.ts View on Github external
execute: () => {
      return NotebookActions.runAndAdvance(
        nbWidget.content,
        nbWidget.context.session
      );
    }
  });
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

      if (current) {
        const { context, content } = current;

        return NotebookActions.runAndAdvance(content, context.session);
      }
    },
    isEnabled
github yuvipanda / simplest-notebook / src / notebook / component.tsx View on Github external
execute: () => {
        NotebookActions.runAndAdvance(
          nbWidget.content,
          nbWidget.context.session
        );
      }
    });
github jupyterlab / jupyterlab / packages / notebook-extension / src / index.ts View on Github external
run: current => {
      const { context, notebook } = current;
      return NotebookActions.runAndAdvance(notebook, context.session)
      .then(() => void 0);
    },
    runAll: current => {
github yuvipanda / simplest-notebook / packages / notebook-extension / src / index.ts View on Github external
run: current => {
      const { context, notebook } = current;
      return NotebookActions.runAndAdvance(notebook, context.session)
      .then(() => void 0);
    },
    runAll: current => {