(backup of the reddit post)
I'm going to share with you my favourite way of using Python and Jupyter for research and reports. And it's not simply using Jupyter. I want to write code in PyCharm and use Pandoc filters for reports.
- Write code in PyCharm - best python IDE with code completion, inspection, quick documentation pop ups (Ctrl+Q, Alt+MouseButton2), quick navigation to declaration (Mouse Button2),
- Atom editor + hydrogen + MagicPython for interactive code execution and instanty seeing plots, dataframes and more,
- Sync Atom with PyCharm via file-watcher (but first disable PyCharm safe write: Settings → Appearance and Behavior → System Settings → Synchronization → Use "safe write"),
- With this combo you also may need to reload imported custom external modules in Hydrogen,
- Write Unicode fast in Atom via sugartex-completions,
- Export Hydrogen document to static Markdown document or Jupyter notebook or docx via Pandoctools based on Pandoc (or export to PDF but this unfortunately needs tuning...),
- During export via Pandoctools use any pandoc or text filter like pandoc-crossref (so you can have cross-references for equations, figures and tables), SugarTeX LaTeX transpiler or a custom filter via panflute,
- Pandoctools stores reusable profiles that define text conversion (written as cross-platform bash pipeline with CLI text filters),
- Preview static Markdown in Atom via markdown-preview-plus,
- Run Pandoctools from Atom via cross-platform unix-filter (setup pandoctools in unix filter),
- ...
- more details about tuning Atom packages and using Pandoctools.
There is an example (from here) that can be edited in PyCharm, interactively run in Atom+Hydrogen and exported via Pandoctools.
Or you can use VS Code instead of PyCharm. Everything seems to work out of the box except you need to install pylint
to each Python env you are going to use. If you would run Jupyter in Atom/Hydrogen then you can disable Jupyter functionality in VS Code: "Data Sciense: Enabled" (this would hide annoying "run cell" inserts).
Or you can do everything in Atom Editor. For this you need to install ide-python (+ enable pylint there), install python-tools, install python-language-server
to each working Python environment and tune pylint
globally: edit or create ~/.pylintrc
file:
[MESSAGES CONTROL]
disable=bad-continuation,missing-docstring,pointless-string-statement,invalid-name,too-many-locals,too-many-arguments
[FORMAT]
max-line-length=119
Create it on Windows:
cd /d %UserProfile%
echo bla > .pylintrc