Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output from Julia chunk broken into two parts #6605

Closed
sje30 opened this issue Oct 28, 2022 · 4 comments
Closed

Output from Julia chunk broken into two parts #6605

sje30 opened this issue Oct 28, 2022 · 4 comments
Labels
status:Needs Info status:Needs Triage Applied to issues that need triage

Comments

@sje30
Copy link

sje30 commented Oct 28, 2022

I've found a problem using 'quarto' when trying to render some simple
Julia code.

A full example of the quarto problem was reported here and
in turn, it was suggested this is a bug in Jupyter.

Example f.ipynb

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8c784318",
   "metadata": {},
   "outputs": [],
   "source": [
    "println(typeof(ones(3,2)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8ed83174",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Julia 1.8.2",
   "language": "julia",
   "name": "julia-1.8"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "1.8.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}

The output from the Julia chunk should be:

Matrix{Float64}

but that is broken over two output chunks as

Matrix{


Float64}

This was generated using:

% jupyter nbconvert f.ipynb --execute --to markdown
[NbConvertApp] Converting notebook f.ipynb to markdown
Starting kernel event loops.
[NbConvertApp] Writing 78 bytes to f.md
stephen@blur ~ % quarto render f.ipynb --execute --to markdown    

Starting julia-1.8 kernel...Done

Executing 'f.ipynb'
  Cell 1/2...Done
  Cell 2/2...Done

pandoc 
  to: markdown
  output-file: f.md
  standalone: true
  default-image-extension: png
  
Output created: f.md

f.md

---
pagetitle: f
toc-title: Table of contents
---

::: {.cell execution_count="1"}
``` {.julia .cell-code}
println(typeof(ones(3,2)))
```

::: {.cell-output .cell-output-stdout}
    Matrix{
:::

::: {.cell-output .cell-output-stdout}
    Float64}
:::
:::

System information

:::

% jupyter kernelspec list
Available kernels:
  ir           /Users/stephen/Library/Jupyter/kernels/ir
  julia-1.8    /Users/stephen/Library/Jupyter/kernels/julia-1.8
  python3      /Users/stephen/.pyenv/versions/3.10.6/share/jupyter/kernels/python3

% jupyter --version
Selected Jupyter core packages...
IPython          : 8.4.0
ipykernel        : 6.15.1
ipywidgets       : not installed
jupyter_client   : 7.3.4
jupyter_core     : 4.11.1
jupyter_server   : 1.18.1
jupyterlab       : 3.4.5
nbclient         : 0.6.6
nbconvert        : 6.5.3
nbformat         : 5.4.0
notebook         : 6.4.12
qtconsole        : not installed
traitlets        : 5.3.0


% uname -a
Darwin blur.lan 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64

% quarto --version
1.1.251


@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to issues that need triage label Oct 28, 2022
@RRosio
Copy link
Collaborator

RRosio commented Nov 3, 2022

Hi @sje30, thank you for submitting this issue. We will keep this open in hopes that someone who uses the iJulia kernel can also verify that this is a jupyter issue but we recommend taking a look at this issue filed in the iJulia repo:JuliaLang/IJulia.jl#1047

@afshin
Copy link
Member

afshin commented Nov 3, 2022

Hi @sje30, I tried running your notebook with Julia 1.8.2 using both JupyterLab (3.5.0) and Jupyter Notebook (6.4.12) and in both cases, the output of my cell was correct:

Screenshot 2022-11-03 at 21 53 20

Screenshot 2022-11-03 at 21 54 45

I wonder if there's a minimum viable script we can follow to reproduce the error. Do you have any suggestions about your environment that might help isolate where the issue is arising?

@sje30
Copy link
Author

sje30 commented Nov 3, 2022

thanks for investigating.

In quarto-dev/quarto-cli#3093 @cscheid noted that he could reproduce the error, but that he had to run the script a couple of times to get the broken output, so maybe it is stochastic?

For me, I got it every time I ran this code (rather than using the web-interface):

jupyter nbconvert f.ipynb --execute --to markdown

so does it make a difference when you run it in batch?

I also though @RRosio had a helpful point, that it seems to occur in other contexts too: JuliaLang/IJulia.jl#1047

@RRosio
Copy link
Collaborator

RRosio commented Nov 10, 2022

Hi @sje30, thank you again for opening this issue. As of now, we don't have a way to reliably reproduce this issue that indicates it is an issue coming from any part of the Jupyter stack. If new information comes up and it indicates that this is a problem with Jupyter we can go ahead and reopen this issue. Thank you!

@RRosio RRosio closed this as completed Nov 10, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:Needs Info status:Needs Triage Applied to issues that need triage
Projects
None yet
Development

No branches or pull requests

3 participants