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

Detect when in console mode #5

Open
rapgenic opened this issue Jan 30, 2021 · 3 comments
Open

Detect when in console mode #5

rapgenic opened this issue Jan 30, 2021 · 3 comments
Assignees
Labels
console Related to jupyter console mode what/toolkit/notebook Related to the native graphics toolkits what/toolkit/plotly Related to the plotly graphics toolkit

Comments

@rapgenic
Copy link
Collaborator

rapgenic commented Jan 30, 2021

Issue:

Notebooks are organised in cells which have their own output that usually depends only on the code contained in the cell itself.

On the other hand, the console is more interactive and sequential.

In octave the main thing that is affected by this behavior are figures (e.g. plots). When a figure is created Octave sets it as the active one and keeps track of it, applying any new command to it.

So in order to avoid having commands in subsequent cells act on a plot displayed on a previous cell the active figure is cleared so that a new one is created (if necessary) on every execution cell.

This does not apply as well on the console, as someone could create a plot in one execution and then in another execution for example add a new trace on it. This does not work as the second execution creates a new empty figure, before adding the trace to it.

Possible solution:

We should try to detect if we are in console mode.

If so, we should not clear the figure on every cell execution, because this does not work well with the concept of console.

Not sure this is actuable

@rapgenic rapgenic added what/toolkit/notebook Related to the native graphics toolkits what/toolkit/plotly Related to the plotly graphics toolkit console Related to jupyter console mode labels Jan 30, 2021
@rapgenic rapgenic self-assigned this Jan 30, 2021
@rapgenic rapgenic added the type/planning 📑 Internal organization issues label Jan 30, 2021
@marimeireles
Copy link
Member

With console mode you mean jupyter console?
I tried to run some cells there and didn't work for me. I wonder if I did something wrong?
I just built it normally, do you know if there's the necessity of having some other stuff installed?

@rapgenic
Copy link
Collaborator Author

rapgenic commented Jun 8, 2021

Actually I meant the console tab in the jupyter lab new document panel. Anyways I tried the jupyter console and not everything works... I believe this has to do with the mime output in the kernel answers, I'm not sure the text/plain is always included, will check that.

I also updated the issue description with more details.

@AntoinePrv AntoinePrv removed the type/planning 📑 Internal organization issues label Sep 21, 2022
@SylvainCorlay
Copy link
Member

Unfortunately, the kernel cannot know whether it is in console or notebook mode, because it could actually be both... Multiple clients can be connected to the same kernel at the same time.

The specific issue about the interactive mode of figures could probably be resolved in the same way we fixed it with matplotlib and ipympl (cc @martinRenou). I wonder if we could do the same with octave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
console Related to jupyter console mode what/toolkit/notebook Related to the native graphics toolkits what/toolkit/plotly Related to the plotly graphics toolkit
Projects
None yet
Development

No branches or pull requests

4 participants