diff --git a/jupyter_notebooks/Tutorials/reporting/ReportGeneration.ipynb b/jupyter_notebooks/Tutorials/reporting/ReportGeneration.ipynb index e7c8ab329..46194cf55 100644 --- a/jupyter_notebooks/Tutorials/reporting/ReportGeneration.ipynb +++ b/jupyter_notebooks/Tutorials/reporting/ReportGeneration.ipynb @@ -326,6 +326,8 @@ "In addition to the standard HTML-page reports demonstrated above, pyGSTi is able to generate a Jupyter notebook containing the Python commands to create the figures and tables within a general report. This is facilitated\n", "by `Workspace` objects, which are factories for figures and tables (see previous tutorials). By calling `Report.write_notebook`, all of the relevant `Workspace` initialization and calls are dumped to a new notebook file, which can be run (either fully or partially) by the user at their convenience. Creating such \"report notebooks\" has the advantage that the user may insert Python code amidst the figure and table generation calls to inspect or modify what is display in a highly customizable fashion. The chief disadvantages of report notebooks is that they require the user to 1) have a Jupyter server up and running and 2) to run the notebook before any figures are displayed.\n", "\n", + "Note that interactive cells in report notebooks require JavaScript, and therefore do not work with JupyterLab. Please continue to use to track this issue, see https://github.com/pyGSTio/pyGSTi/issues/205.\n", + "\n", "The line below demonstrates how to create a report notebook using `write_notebook`. Note that the argument list is very similar to the other `Report` output methods." ] }, @@ -365,7 +367,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.10.10" } }, "nbformat": 4, diff --git a/pygsti/report/report.py b/pygsti/report/report.py index 09697d012..651231ad4 100644 --- a/pygsti/report/report.py +++ b/pygsti/report/report.py @@ -206,6 +206,11 @@ def write_notebook(self, path, auto_open=False, connected=False, verbosity=0): who want to tinker with the standard analysis presented in the static HTML or LaTeX format reports. + Note that interactive cells in report notebooks require JavaScript, + and therefore do not work with JupyterLab. Please continue to use + classic Jupyter notebooks for PyGSTi report notebooks. To track this issue, + see https://github.com/pyGSTio/pyGSTi/issues/205. + Parameters ---------- path : str or path-like object @@ -249,6 +254,12 @@ def write_notebook(self, path, auto_open=False, connected=False, verbosity=0): nb = _Notebook() nb.add_markdown('# {title}\n(Created on {date})'.format( title=title, date=_time.strftime("%B %d, %Y"))) + + nb.add_markdown("## JupyterLab Incompatibility Warning\n" + + "Note that interactive cells in report notebooks require JavaScript, " + + "and therefore do not work with JupyterLab. Please continue to use " + + "classic Jupyter notebooks for PyGSTi report notebooks. To track this issue, " + + "see https://github.com/pyGSTio/pyGSTi/issues/205.") nb.add_code("""\ import pickle @@ -353,6 +364,11 @@ def write_notebook(self, path, auto_open=False, connected=False, verbosity=0): printer.log("Report Notebook created as %s" % path) + printer.warning("""Note that interactive cells in report notebooks require JavaScript, + and therefore do not work with JupyterLab. Please continue to use + classic Jupyter notebooks for PyGSTi report notebooks. To track this issue, + see https://github.com/pyGSTio/pyGSTi/issues/205.""") + if auto_open: port = "auto" if auto_open is True else int(auto_open) nb.launch(str(path), port=port)