question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What's the best start of cell marker for Python and Julia scripts?

See original GitHub issue

We’re currently using # + {} as start of cell marker. But possibly # + (when not following a commented line) would be just enough. And also, Hydrogen seems to use # %%name of cell. Can we design a common, simple and clear pattern?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mwoutscommented, Sep 6, 2018

Sure! Yet,

  • Jupytext has a very different practice of cells markers (few explicit markers, start+end) than Hydrogen (all cells are marked, start only). This is also discussed here. Hydrogen syntax is simpler to parse. Jupytext’s cells are more difficult to parse, but arbitrary python files can be converted to notebooks, and converted back to the original python files without loss or additional markers.
  • The definition of markdown cells in Hydrogen is pending (https://github.com/nteract/hydrogen/issues/1296, https://github.com/nteract/hydrogen/issues/1183)

For now I would be in favor of

  • preserving the current ‘plain python’ format for Jupytext’s python scripts, and simplify # + {} to # + for explicit code cells with no metadata
  • implementing a ‘hydrogen script’ format (R, Julia, Python) in Jupytext when specifications for markdown cells (and cell metadata) are chosen. The Hydrogen format must remain easy to parse (simply split on cell markers), as an additional JavaScript parser will have to be implemented in Atom.
0reactions
mwoutscommented, Sep 6, 2018

I’ll work on an Hydrogen/VS code/Spyder compatible format at #59 (see there for possible specifications of the format). With this issue I’ll just simplify # + {} into the lighter # + when possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Experience from a Julia Perspective | by Erik Engheim
Here are some of my observations about using Python again after primarily using Julia for my scripting needs. First Impressions. The built in...
Read more >
Jupyter Notebooks as Markdown Documents, Julia, Python or ...
Jupyter Notebooks as Markdown Documents, Julia, Python or R Scripts¶. Have you always wished Jupyter notebooks were plain text documents?
Read more >
Machine Learning in Julia - Towards Data Science
Run Julia in Jupyter Notebook · Download and install Julia from their website · Open the Julia Command Line · Run the command...
Read more >
My mental load using Julia is much higher than, e.g., in Python ...
Hi, I'm new to the language, and although I like so many aspects of Julia, I am struggling to start using it. I...
Read more >
Setting up a Julia workflow in Emacs - Hersh Singh
This is my favorite part of the workflow. Julia code between ### is treated as a “cell”. If you press C-Ret , the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found