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.

Wrong cell separation when creating .ipynb from .py

See original GitHub issue

Let’s say I work in a notebook file, paired to a .py file, and write one function per cell.

When I re-generate the .ipynb notebook from the .py file I have noticed that some functions now live in the same cell.

This is best illustrated by the images below. The following code: Screenshot 2020-03-17 at 21 43 10

becomes, after regenerating the .ipynb from the paired .py: Screenshot 2020-03-17 at 21 36 20

The problem does not impact all functions/cells. I’ve inspected the code in the .py file and cannot find any obvious difference between the impacted cells/functions and the non impacted ones.

I’m using jupytext version 1.4.0 but had noticed this behaviour on previous versions too.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jheliecommented, Mar 29, 2020

Glad to hear this was fixable - thanks for doing so so quickly!

1reaction
mwoutscommented, Mar 28, 2020

What was happening is that the parser was seeing """ twice in the quadruple quote… You won’t have this issue any more in the next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

collapse cell in jupyter notebook - python - Stack Overflow
I want the function to remain executed and callable, yet I want to hide / collapse the cell in order to better visualize...
Read more >
Notebook formats - Jupytext documentation - Read the Docs
In the Markdown format, markdown cells are inserted verbatim and separated with two blank lines. If you'd like that cell breaks also occurs...
Read more >
Refactoring a Jupyter notebook into a maintainable pipeline
Open pipeline. ipynb in Jupyter and run it from top to bottom (ensure you turn sample=False to use the entire dataset). Then, on...
Read more >
Jupyter Notebook Users Manual.ipynb - Bryn Mawr College
Go to this section for more information on how to create a slideshow out of your Jupyter ... By default, Jupyter Notebooks' Code...
Read more >
The Jupyter Notebook Interface - Problem Solving with Python
Note that the file extension .ipynb is not printed in the file name field, ... Headings are created in markdown cells using 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