How to use the @jupyterlab/notebook.NotebookActions.runAll 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 render all markdown cells on an error', async () => {
        widget.activeCell.model.value.text = ERROR_INPUT;
        const cell = widget.widgets[1] as MarkdownCell;
        cell.rendered = false;
        const result = await NotebookActions.runAll(widget, ipySession);
        // Markdown rendering is asynchronous, but the cell
        // provides no way to hook into that. Sleep here
        // to make sure it finishes.
        await sleep(100);
        expect(result).to.equal(false);
        expect(cell.rendered).to.equal(true);
        await ipySession.kernel.restart();
      }).timeout(60000); // 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);
        const result = await NotebookActions.runAll(widget, ipySession);
        expect(result).to.equal(false);
        expect(cell.executionCount).to.be.null;
        expect(widget.activeCellIndex).to.equal(widget.widgets.length - 1);
        await ipySession.kernel.restart();
      }).timeout(30000); // Allow for slower CI
github yuvipanda / simplest-notebook / packages / notebook-extension / src / index.ts View on Github external
runAll: current => {
      const { context, notebook } = current;
      return NotebookActions.runAll(notebook, context.session)
      .then(() => void 0);
    },
    restartAndRunAll: current => {
github yuvipanda / simplest-notebook / packages / notebook-extension / src / index.ts View on Github external
return session.restart().then(restarted => {
          if (restarted) {
            NotebookActions.runAll(notebook, context.session);
          }
          return restarted;
        });
      }
github spyder-ide / spyder-notebook / spyder_notebook / server / src / commands.ts View on Github external
execute: () => {
      return NotebookActions.runAll(
        nbWidget.content,
        nbWidget.context.session
      );
    }
  });
github spyder-ide / spyder-notebook / spyder_notebook / server / src / commands.ts View on Github external
return nbWidget.session.restart().then(restarted => {
        if (restarted) {
          void NotebookActions.runAll(
            nbWidget.content,
            nbWidget.context.session
          );
        }
        return restarted;
      });
    }
github jupyterlab / jupyterlab / packages / notebook-extension / src / index.ts View on Github external
          .then(() => { NotebookActions.runAll(notebook, context.session); });
      }
github altair-viz / jupyterlab_voyager / src / index.ts View on Github external
source: [
                  "import altair as alt\n",
                  "import pandas as pd\n",
                  "import json\n",
                  `with open('${PathExt.basename(
                    context.path
                  )}') as json_data:\n`,
                  "    data_src = json.load(json_data)\n",
                  "data = data_src['data']\n",
                  "alt.Chart.from_dict(data_src)\n"
                ]
              }
            ];
            (widget as NotebookPanel).model.fromJSON(md);
            widget.context.save();
            NotebookActions.runAll(widget.notebook, widget.context.session);
          });
      });
github yuvipanda / simplest-notebook / src / notebook / component.tsx View on Github external
nbWidget.context.session.restart().then(() => {
          NotebookActions.runAll(nbWidget.content, nbWidget.context.session);
        });
      }
github yuvipanda / simplest-notebook / packages / notebook-extension / src / index.ts View on Github external
.then(restarted => {
        if (restarted) {
          NotebookActions.runAll(notebook, context.session);
        }
        return restarted;
      });
    }