How to use the @jupyterlab/notebook.NotebookActions.run 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-data-explorer / tests / test-notebook / src / actions.spec.ts View on Github external
it('should stop executing code cells on an error', async () => {
        let cell = widget.model.contentFactory.createCodeCell({});
        cell.value.text = ERROR_INPUT;
        widget.model.cells.insert(2, cell);
        widget.select(widget.widgets[2]);
        cell = widget.model.contentFactory.createCodeCell({});
        widget.model.cells.push(cell);
        widget.select(widget.widgets[widget.widgets.length - 1]);
        const result = await NotebookActions.run(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 / tests / test-notebook / src / actions.spec.ts View on Github external
it('should stop executing code cells on an error', async () => {
        let cell = widget.model.contentFactory.createCodeCell({});
        cell.value.text = ERROR_INPUT;
        widget.model.cells.insert(2, cell);
        widget.select(widget.widgets[2]);
        cell = widget.model.contentFactory.createCodeCell({});
        widget.model.cells.push(cell);
        widget.select(widget.widgets[widget.widgets.length - 1]);
        const result = await NotebookActions.run(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 / tests / test-notebook / src / actions.spec.ts View on Github external
it('should delete deletedCells metadata when cell run', () => {
        let cell = widget.activeCell as CodeCell;
        cell.model.outputs.clear();
        return NotebookActions.run(widget, session).then(result => {
          expect(result).to.equal(true);
          expect(widget.model.deletedCells.length).to.equal(0);
        });
      });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / actions.spec.ts View on Github external
it('should change to command mode', async () => {
        widget.mode = 'edit';
        const result = await NotebookActions.run(widget, session);
        expect(result).to.equal(true);
        expect(widget.mode).to.equal('command');
      });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / actions.spec.ts View on Github external
it('should handle no session', async () => {
        const result = await NotebookActions.run(widget, null);
        expect(result).to.equal(true);
        const cell = widget.activeCell as CodeCell;
        expect(cell.model.executionCount).to.be.null;
      });
github yuvipanda / simplest-notebook / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

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

        return NotebookActions.run(notebook, context.session);
      }
    },
    isEnabled
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.run(content, context.session);
      }
    },
    isEnabled
github spyder-ide / spyder-notebook / spyder_notebook / server / src / commands.ts View on Github external
execute: () => {
      return NotebookActions.run(
        nbWidget.content,
        nbWidget.context.session
      );
    }
  });
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.run(notebook, context.session);
      }
    },
    isEnabled
github jwkvam / jupyterlab-vim / src / index.ts View on Github external
execute: args => {
                const current = getCurrent(args);

                if (current) {
                    const { context, content } = current;
                    NotebookActions.run(content, context.session);
                    current.content.mode = 'edit';
                }
            },
            isEnabled