Opened 9 years ago

Closed 7 years ago

#3705 closed enhancement (fixed)

Implement jupyter-openmodelica in addition to OMNotebook

Reported by: dietmarw Owned by: adeas31
Priority: normal Milestone: 1.12.0
Component: OMPython Version:
Keywords: jupyter Cc: petfr, arun3688

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 Changed 9 years ago by Christoph <buchner@…>

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 Changed 9 years ago by sjoelund.se

  • Cc petfr added

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

comment:3 Changed 9 years ago by sjoelund.se

  • Cc arun3688 added

comment:4 Changed 8 years ago by atomymous

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

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

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 Changed 8 years ago by stefan@…

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 Changed 8 years ago by arun3688

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 Changed 8 years ago by dietmarw

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 Changed 7 years ago by sjoelund.se

  • Component changed from OMNotebook to OMPython
  • Milestone changed from Future to 1.12.0
  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from Idea: Use the power of Jupyter for/instead of OMNotebook to Implement jupyter-openmodelica in addition to OMNotebook
  • Type changed from discussion to enhancement
Note: See TracTickets for help on using tickets.