jupytext
jupytext copied to clipboard
jupytext plugin for pycharm.
Hi,
It seems there is still no jupytext plugin for pycharm.
Any hints?
Regards
Hello @hongyi-zhao , that is correct, we don't have a plugin for PyCharm yet. Note that we discussed that previously at #147, but I think now the notebook mode of PyCharm Professional works well - do you think the plugin would still be useful?
Also, in my experience, even without a plugin, jupytext works well with PyCharm. You just have to pair your .ipynb
notebooks with .py
files, using either the Jupytext menu or command in Jupyter, or with e.g. jupytext --set-formats ipynb,py:percent *.ipynb
. And then, once you've edited your .py
files, the changes are pushed to the notebook when you either reload the notebook in Jupyter, or run jupytext --sync *.ipynb
.
Hello @hongyi-zhao , that is correct, we don't have a plugin for PyCharm yet. Note that we discussed that previously at #147, but I think now the notebook mode of PyCharm Professional works well - do you think the plugin would still be useful?
I set the following option in ~/.jupyter/jupyter_notebook_config.py:
c.NotebookApp.contents_manager_class = "jupytext.TextFileContentsManager"
c.ContentsManager.default_jupytext_formats = "ipynb,py:percent"
c.ContentsManager.outdated_text_notebook_margin = float("inf")
It seems this mode doesn't respect the paring settings.
Also, in my experience, even without a plugin, jupytext works well with PyCharm. You just have to pair your
.ipynb
notebooks with.py
files, using either the Jupytext menu or command in Jupyter, or with e.g.jupytext --set-formats ipynb,py:percent *.ipynb
. And then, once you've edited your.py
files, the changes are pushed to the notebook when you either reload the notebook in Jupyter, or runjupytext --sync *.ipynb
.
Thanks for your detail notes.
I got a little lost on how to pair for PyCharm Professional to make or maintain the pairing through jupytext. Is it really straightforward? I mean have them paired in the sense that as you edit the notebook (ipynb) file in PyCharm, it updates the markdown/python mirror file which goes to git. Which is our flow with Jupyter Lab at least, and seems like the more natural way of working up notebooks to me.
Is it supposed to work with PyCharm?
Okay I think I get your suggestion ― basically, just manage the sync from outside of PyCharm if I get it right ― and hopefully PyCharm will not shoot you in the foot when the syncing is taking place from a command-line, nor when the Jupyter server which PyCharm Professional is connecting to is triggering the sync.
I'm not sure if anyone here has the same experience and can check this problem. I haven't used PyCharm for a long time since this issue was submitted.