You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
PDL's output can be corrupt in the Jupyter notebook
To Reproduce
Open our example examples/notebooks/pdl.ipynb and run the very first example.
The output is some variation of
What is the meaning of life?
The meaning of life is a philosophical and metaphysical question related to the purpose or significance of life or existence in general. This question has been asked for centuries and doesn't have a definitive answer as it can vary greatly depending on one's personal beliefs, cultural background, religious faith, or philosophical perspective.
Some people find meaning through personal growth, relationships, love, or through contributing to the betterment of humanity. Others may find it through spirituality or religious beliefs, seeing life as a test or a journey towards a higher purpose.
life has no inherent meaning, and it's up to each individual to create their own purpose. On the other hand, some philosophical and religious traditions propose that the meaning of life is to seek God, attain enlightenment, or achieve harmony with the universe.
life is a deeply personal and subjective concept. It's something that each person might need to explore and discover for themselves.
Expected behavior
The third and fourth paragraphs are missing some text. The last paragraph should be
In essence, the meaning of life is a deeply personal and subjective concept. It's something that each person might need to explore and discover for themselves.
Additional notes
To reproduce, test using a version of PDL with #601 merged because earlier versions did not default the temperature to 0.
I am testing with JupyterLab Version 4.3.4.
The text was updated successfully, but these errors were encountered:
The problem seems to be a Jupyter bug. If instead of using PDL I replace our cell magic with
defpdl(self, line, cell, local_ns):
print("\x1b[32mThe meaning of life is a philosophical and metaphysical question.\n\nSome people \x1b[0m", end="", flush=True)
print("More text.")
return
I get corrupted output. (Removing the flush=True fixes the problem.)
Created jupyterlab/jupyterlab#17358 to track. The problem is not related to coloring or the extension. It seems to be a general problem with flush=True and newlines in Jupyter.
However, although setting flush=False seems to improve the output, the output is still broken for me in Jupyter. It is not the coloring that is the problem. Investigating.
Describe the bug
PDL's output can be corrupt in the Jupyter notebook
To Reproduce
Open our example examples/notebooks/pdl.ipynb and run the very first example.
The output is some variation of
Expected behavior
The third and fourth paragraphs are missing some text. The last paragraph should be
Additional notes
To reproduce, test using a version of PDL with #601 merged because earlier versions did not default the temperature to 0.
I am testing with JupyterLab Version 4.3.4.
The text was updated successfully, but these errors were encountered: