Opened 9 years ago

Closed 7 years ago

#3705 closed enhancement (fixed)

Implement jupyter-openmodelica in addition to OMNotebook

Reported by: Dietmar Winkler Owned by: Adeel Asghar
Priority: normal Milestone: 1.12.0
Component: OMPython Version:
Keywords: jupyter Cc: Peter Fritzson, arunkumar palanisamy

Description

I was wondering if anybody has considered to write a kernel for the Jupyter Notebook. That way one could use all the nice and constantly growing features of Jupyter for Modelica code using an OpenModelica kernel. So far more than 40 languages are already supported and Modelica (via OpenModelica) could be yet another one.

Sounds to me like a good candidate for a Master's thesis.

Change History (9)

comment:1 by Christoph <buchner@…>, 9 years ago

That sounds like a good idea to me. Here is the list of currently available kernels.

Here is the instruction document for how to make a kernel. Quoting from this:

There are two options for writing a kernel:

  1. You can reuse the IPython kernel machinery to handle the communications, and just describe how to execute your code. This is much simpler if the target language can be driven from Python. See Making simple Python wrapper kernels for details.
  2. You can implement the kernel machinery in your target language. This is more work initially, but the people using your kernel might be more likely to contribute to it if it’s in the language they know.

Maybe (updating and) using OMPython for this would be a good way to get results quickly?

comment:2 by Martin Sjölund, 9 years ago

Cc: Peter Fritzson added

This is an alternative to the OMNotebook web application currently being developed.

comment:3 by Martin Sjölund, 9 years ago

Cc: arunkumar palanisamy added

comment:4 by atomymous , 8 years ago

Jupyter kernels could then also be used in other applications,
see this nice example:
https://atom.io/packages/hydrogen

comment:5 by Christoph Buchner <buchner@…>, 8 years ago

According to the 1.11-beta2 release notes, a Jupyter notebook Modelica mode is now available in OpenModelica. However, this ticket is not closed, and I can't find a reference to jupyter anywhere in the OMEdit UI or by searching in the OM user guide.
How does one get to the jupyter Modelica mode (kernel?) ?

comment:6 by stefan@…, 8 years ago

I managed to get the OpenModelica Jupyter Notebook to run.
Here is what I did (I am assuming that you already have a "normal" Jupyter install running. In my case, I was using Anaconda 3 on Windows 7):

  1. Install the Openmodelica Python packages that came as part of the OpenModelica installation in your python environment:

1.1.: change directory to C:\OpenModelica1.11.0-64bit\share\omc\scripts\PythonInterface
1.1.: run python setup.py install

  1. Install Jupyter openmodelica

2.1.: Download/clone jupyter_openmodelica from https://github.com/OpenModelica/jupyter-openmodelica
2.2.: install jupyter_openmodelica with python setup.py install

Now you should be able to create new Jupyter notebooks with openmodelica

comment:7 by arunkumar palanisamy, 8 years ago

As stefan said that is the procedure to run jupyter Openmodelica, Also information is provided in the git repository. look for README.md

https://github.com/OpenModelica/jupyter-openmodelica

I will also add a documentation to users guide.

@adeas31 adeel can you close this ticket

comment:8 by Dietmar Winkler, 8 years ago

Ha I was going to ask exactly where to find that information since there was no link in the release notes of this nice new feature.

One other thing, are there plans to push releases of openmodelica-python and jupyter-openmodelica to https://pypi.python.org/pypi ? That would simplify the installation process even more.

comment:9 by Martin Sjölund, 7 years ago

Component: OMNotebookOMPython
Milestone: Future1.12.0
Resolution: fixed
Status: newclosed
Summary: Idea: Use the power of Jupyter for/instead of OMNotebookImplement jupyter-openmodelica in addition to OMNotebook
Type: discussionenhancement
Note: See TracTickets for help on using tickets.