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

matlab_kernel not reset on reprocessing of Quarto document in VS Code #163

Open
allefeld opened this issue Mar 16, 2023 · 0 comments
Open

Comments

@allefeld
Copy link

allefeld commented Mar 16, 2023

I posted the following previously on Stack Overflow but didn't receive any answers or comments, so I'm trying here:

There is something strange happening when using matlab_kernel in a document processed by the Quarto extension for VS Code.

Example file quarto_matlab_test.qmd:

---
title: test quarto & matlab_kernel
jupyter: matlab
---

```{matlab}
x
```

```{matlab}
x = 2
```
  • When this document is processed for the first time, there is an error message from the first code block about x not being defined, which is correct.

  • If the same document is processed for the second time, the error message disappears and the value x = 2 is reported.

It appears that the Matlab kernel is not reset between Quarto processing runs, and variables as well as other settings are preserved.

The same does not happen with a Python kernel, and it does not happen with matlab_kernel in a notebook (ipynb). I'm not sure whether this is a bug in matlab_kernel, Jupyter, Quarto, or the Quarto extension.

Questions:

  1. How do I debug this, so I can submit a bug report for the software which is the actual culprit? There are so many different pieces involved (see below).

  2. Is there a workaround? A partial solution is to put clear variables into a code block at the top – but as mentioned this also applies to other settings (e.g. format), so it seems that one needs to figure out a sequence of reset commands depending on the document.

Versions:

Python 3.10.4
    jupyter_client 7.3.1
    jupyter_core 4.10.0
    matlab-kernel 0.17.1
    metakernel 0.29.4
    matlabengine 9.13.7
Matlab R2022b Update 4 (9.13.0.2166757)
Quarto 1.2.335
VS Code 1.75.1
    Quarto Extension 1.69.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant