From 6a69179c81510a9acb6c943cecbf039efb006884 Mon Sep 17 00:00:00 2001 From: coatless Date: Fri, 1 Mar 2024 08:30:39 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20coatless?= =?UTF-8?q?-quarto/pyodide@a07cb6a024c9c94669457111c75616edce6d80c6=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/blog/index.html | 4 ++-- examples/blog/posts/post-with-code/index.html | 2 +- examples/book/example-page.html | 2 +- examples/book/index.html | 2 +- examples/html-document/index.html | 2 +- examples/readme/index.html | 2 +- examples/revealjs/index.html | 4 ++-- examples/website/example-page.html | 2 +- examples/website/index.html | 2 +- index.html | 2 +- qpyodide-code-cell-demo.html | 4 ++-- qpyodide-first-steps.html | 2 +- search.json | 2 +- tests/index.html | 2 +- tests/qpyodide-test-graphic-output.html | 2 +- tests/qpyodide-test-internal-cell.html | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/blog/index.html b/examples/blog/index.html index a583510..4a30ffd 100644 --- a/examples/blog/index.html +++ b/examples/blog/index.html @@ -205,7 +205,7 @@
Categories
-
+
-
+

diff --git a/examples/blog/posts/post-with-code/index.html b/examples/blog/posts/post-with-code/index.html index 91ea4d7..07845ec 100644 --- a/examples/blog/posts/post-with-code/index.html +++ b/examples/blog/posts/post-with-code/index.html @@ -230,7 +230,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"options":{"context":"interactive","out-width":"700px","read-only":"false","message":"true","classes":"","fig-width":7,"dpi":72,"fig-cap":"","warning":"true","out-height":"","fig-height":5,"comment":"","label":"","results":"markup","output":"true","autorun":""},"code":"print(\"Hello {quarto-pyodide} blog world!\")","id":1}]; +globalThis.qpyodideCellDetails = [{"id":1,"options":{"fig-height":5,"fig-width":7,"label":"","output":"true","fig-cap":"","out-width":"700px","read-only":"false","warning":"true","dpi":72,"message":"true","classes":"","comment":"","context":"interactive","results":"markup","autorun":"","out-height":""},"code":"print(\"Hello {quarto-pyodide} blog world!\")"}]; diff --git a/examples/book/example-page.html b/examples/book/example-page.html index d2972db..307d8b0 100644 --- a/examples/book/example-page.html +++ b/examples/book/example-page.html @@ -230,7 +230,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"code":"import numpy as np\n\n# Data for plotting\nt = np.arange(0.0, 2.0, 0.01)\ns = 1 + np.sin(2 * np.pi * t)\n\n# Print t\nprint(f\"Displaying 10 observations of `t`:\\n{t[:10]}\\n\")\n\nprint(\"Showing the first 10 values of `s`:\")\n# The last object in the cell does not need print.\ns[:10]","id":1,"options":{"comment":"","results":"markup","warning":"true","read-only":"false","context":"interactive","classes":"","output":"true","dpi":72,"fig-cap":"","fig-width":7,"autorun":"","label":"","out-width":"700px","message":"true","fig-height":5,"out-height":""}},{"code":"import matplotlib.pyplot as plt\n\nfig, ax = plt.subplots()\nax.plot(t, s)\n\nax.set(xlabel='time (s)', ylabel='voltage (mV)',\n title='About as simple as it gets, folks')\nax.grid()\n\nplt.show()","id":2,"options":{"comment":"","results":"markup","warning":"true","read-only":"false","context":"interactive","classes":"","output":"true","dpi":72,"fig-cap":"","fig-width":7,"autorun":"","label":"","out-width":"700px","message":"true","fig-height":5,"out-height":""}}]; +globalThis.qpyodideCellDetails = [{"options":{"fig-height":5,"read-only":"false","label":"","output":"true","out-width":"700px","context":"interactive","out-height":"","dpi":72,"comment":"","warning":"true","autorun":"","classes":"","results":"markup","message":"true","fig-width":7,"fig-cap":""},"id":1,"code":"import numpy as np\n\n# Data for plotting\nt = np.arange(0.0, 2.0, 0.01)\ns = 1 + np.sin(2 * np.pi * t)\n\n# Print t\nprint(f\"Displaying 10 observations of `t`:\\n{t[:10]}\\n\")\n\nprint(\"Showing the first 10 values of `s`:\")\n# The last object in the cell does not need print.\ns[:10]"},{"options":{"fig-height":5,"read-only":"false","label":"","output":"true","out-width":"700px","context":"interactive","out-height":"","dpi":72,"comment":"","warning":"true","autorun":"","classes":"","results":"markup","message":"true","fig-width":7,"fig-cap":""},"id":2,"code":"import matplotlib.pyplot as plt\n\nfig, ax = plt.subplots()\nax.plot(t, s)\n\nax.set(xlabel='time (s)', ylabel='voltage (mV)',\n title='About as simple as it gets, folks')\nax.grid()\n\nplt.show()"}]; diff --git a/examples/book/index.html b/examples/book/index.html index 51b593f..e679156 100644 --- a/examples/book/index.html +++ b/examples/book/index.html @@ -231,7 +231,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"id":1,"code":"print(\"Hello there! Welcome to a {quarto-pyodide} powered book!\")","options":{"output":"true","warning":"true","message":"true","comment":"","fig-width":7,"out-height":"","classes":"","label":"","context":"interactive","autorun":"","out-width":"700px","dpi":72,"results":"markup","fig-height":5,"fig-cap":"","read-only":"false"}}]; +globalThis.qpyodideCellDetails = [{"id":1,"code":"print(\"Hello there! Welcome to a {quarto-pyodide} powered book!\")","options":{"message":"true","context":"interactive","classes":"","output":"true","fig-cap":"","label":"","results":"markup","read-only":"false","autorun":"","out-height":"","comment":"","warning":"true","fig-width":7,"fig-height":5,"out-width":"700px","dpi":72}}]; diff --git a/examples/html-document/index.html b/examples/html-document/index.html index bebd594..b1a6ada 100644 --- a/examples/html-document/index.html +++ b/examples/html-document/index.html @@ -195,7 +195,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"code":"print(\"Hello there! Welcome to a quarto-pyodide powered HTML Document!\")","options":{"warning":"true","context":"interactive","results":"markup","dpi":72,"output":"true","message":"true","fig-height":5,"label":"","out-height":"","autorun":"","out-width":"700px","read-only":"false","comment":"","fig-cap":"","classes":"","fig-width":7},"id":1}]; +globalThis.qpyodideCellDetails = [{"id":1,"options":{"dpi":72,"read-only":"false","classes":"","out-height":"","message":"true","comment":"","warning":"true","out-width":"700px","fig-cap":"","output":"true","autorun":"","fig-height":5,"context":"interactive","label":"","results":"markup","fig-width":7},"code":"print(\"Hello there! Welcome to a quarto-pyodide powered HTML Document!\")"}]; diff --git a/examples/readme/index.html b/examples/readme/index.html index 49eb2ea..1bf5bda 100644 --- a/examples/readme/index.html +++ b/examples/readme/index.html @@ -195,7 +195,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"id":1,"options":{"read-only":"false","fig-height":5,"autorun":"","warning":"true","context":"interactive","message":"true","comment":"","output":"true","fig-cap":"","classes":"","dpi":72,"fig-width":7,"label":"","out-width":"700px","results":"markup","out-height":""},"code":"n = 5\nwhile n > 0:\n print(n)\n n = n - 1\n\nprint('Blastoff!')"}]; +globalThis.qpyodideCellDetails = [{"id":1,"code":"n = 5\nwhile n > 0:\n print(n)\n n = n - 1\n\nprint('Blastoff!')","options":{"results":"markup","dpi":72,"warning":"true","fig-width":7,"message":"true","fig-height":5,"out-width":"700px","context":"interactive","output":"true","autorun":"","classes":"","label":"","read-only":"false","fig-cap":"","out-height":"","comment":""}}]; diff --git a/examples/revealjs/index.html b/examples/revealjs/index.html index 836a8b8..4bdbf64 100644 --- a/examples/revealjs/index.html +++ b/examples/revealjs/index.html @@ -483,7 +483,7 @@ } // Store cell data - globalThis.qpyodideCellDetails = [{"options":{"autorun":"","fig-height":5,"comment":"","message":"true","out-width":"700px","out-height":"","context":"interactive","dpi":72,"classes":"","warning":"true","results":"markup","output":"true","fig-width":7,"read-only":"false","fig-cap":"","label":""},"id":1,"code":"n = 5\nwhile n > 0:\n print(n)\n n = n - 1\n\nprint('Blastoff!')"},{"options":{"autorun":"","fig-height":5,"comment":"","message":"true","out-width":"700px","out-height":"","context":"interactive","dpi":72,"classes":"","warning":"true","results":"markup","output":"true","fig-width":7,"read-only":"false","fig-cap":"","label":""},"id":2,"code":"import matplotlib.pyplot as plt\nimport numpy as np\n\nx = np.linspace(0, 2*np.pi, 100)\ny = np.sin(x)\nplt.plot(x, y)\nplt.title('Sine wave')\nplt.show()"},{"options":{"autorun":"","fig-height":5,"comment":"","message":"true","out-width":"700px","out-height":"","context":"interactive","dpi":72,"classes":"","warning":"true","results":"markup","output":"true","fig-width":7,"read-only":"false","fig-cap":"","label":""},"id":3,"code":"def say_hello(name):\n _________(f\"Hello there {name}!\")\n\nsay_hello(\"quarto-pyodide\")"},{"options":{"autorun":"","fig-height":5,"comment":"","message":"true","out-width":"700px","out-height":"","context":"interactive","dpi":72,"classes":"","warning":"true","results":"markup","output":"true","fig-width":7,"read-only":"false","fig-cap":"","label":""},"id":4,"code":"print(\"Hello quarto-pyodide RevealJS world!\")\n\n[x**2 for x in range(0, 5)]\n\n3 + 5"}]; + globalThis.qpyodideCellDetails = [{"id":1,"code":"n = 5\nwhile n > 0:\n print(n)\n n = n - 1\n\nprint('Blastoff!')","options":{"label":"","dpi":72,"fig-cap":"","output":"true","message":"true","results":"markup","context":"interactive","classes":"","comment":"","out-width":"700px","read-only":"false","fig-height":5,"autorun":"","warning":"true","fig-width":7,"out-height":""}},{"id":2,"code":"import matplotlib.pyplot as plt\nimport numpy as np\n\nx = np.linspace(0, 2*np.pi, 100)\ny = np.sin(x)\nplt.plot(x, y)\nplt.title('Sine wave')\nplt.show()","options":{"label":"","dpi":72,"fig-cap":"","output":"true","message":"true","results":"markup","context":"interactive","classes":"","comment":"","out-width":"700px","read-only":"false","fig-height":5,"autorun":"","warning":"true","fig-width":7,"out-height":""}},{"id":3,"code":"def say_hello(name):\n _________(f\"Hello there {name}!\")\n\nsay_hello(\"quarto-pyodide\")","options":{"label":"","dpi":72,"fig-cap":"","output":"true","message":"true","results":"markup","context":"interactive","classes":"","comment":"","out-width":"700px","read-only":"false","fig-height":5,"autorun":"","warning":"true","fig-width":7,"out-height":""}},{"id":4,"code":"print(\"Hello quarto-pyodide RevealJS world!\")\n\n[x**2 for x in range(0, 5)]\n\n3 + 5","options":{"label":"","dpi":72,"fig-cap":"","output":"true","message":"true","results":"markup","context":"interactive","classes":"","comment":"","out-width":"700px","read-only":"false","fig-height":5,"autorun":"","warning":"true","fig-width":7,"out-height":""}}]; @@ -692,7 +692,7 @@

matplotlib Graphing with Pyodide

quarto-{pyodide + countdown}

Pair code cells with a countdown timer to allow for practice

-
+
diff --git a/examples/website/example-page.html b/examples/website/example-page.html index b9578f7..d87bdcf 100644 --- a/examples/website/example-page.html +++ b/examples/website/example-page.html @@ -228,7 +228,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"code":"import pandas as pd \nimport numpy as np \n\ndf = pd.DataFrame(\n {\n \"A\": 1.0,\n \"B\": pd.Timestamp(\"20130102\"),\n \"C\": pd.Series(1, index=list(range(4)), dtype=\"float32\"),\n \"D\": np.array([3] * 4, dtype=\"int32\"),\n \"E\": pd.Categorical([\"test\", \"train\", \"test\", \"train\"]),\n \"F\": \"foo\",\n }\n)\n\n\ndf","options":{"autorun":"","warning":"true","read-only":"false","out-height":"","fig-cap":"","label":"","comment":"","message":"true","context":"interactive","classes":"","output":"true","out-width":"700px","fig-width":7,"dpi":72,"results":"markup","fig-height":5},"id":1}]; +globalThis.qpyodideCellDetails = [{"options":{"label":"","fig-cap":"","warning":"true","classes":"","out-width":"700px","context":"interactive","dpi":72,"message":"true","autorun":"","out-height":"","output":"true","comment":"","results":"markup","fig-height":5,"fig-width":7,"read-only":"false"},"id":1,"code":"import pandas as pd \nimport numpy as np \n\ndf = pd.DataFrame(\n {\n \"A\": 1.0,\n \"B\": pd.Timestamp(\"20130102\"),\n \"C\": pd.Series(1, index=list(range(4)), dtype=\"float32\"),\n \"D\": np.array([3] * 4, dtype=\"int32\"),\n \"E\": pd.Categorical([\"test\", \"train\", \"test\", \"train\"]),\n \"F\": \"foo\",\n }\n)\n\n\ndf"}]; diff --git a/examples/website/index.html b/examples/website/index.html index 4a30eb4..c7bd664 100644 --- a/examples/website/index.html +++ b/examples/website/index.html @@ -228,7 +228,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"id":1,"code":"print(\"Hello there! Welcome to a quarto-pyodide powered website!\")","options":{"comment":"","message":"true","out-width":"700px","fig-width":7,"warning":"true","dpi":72,"output":"true","context":"interactive","label":"","read-only":"false","autorun":"","results":"markup","fig-cap":"","classes":"","out-height":"","fig-height":5}}]; +globalThis.qpyodideCellDetails = [{"id":1,"options":{"out-width":"700px","read-only":"false","output":"true","results":"markup","fig-width":7,"comment":"","message":"true","label":"","warning":"true","autorun":"","fig-height":5,"classes":"","dpi":72,"out-height":"","context":"interactive","fig-cap":""},"code":"print(\"Hello there! Welcome to a quarto-pyodide powered website!\")"}]; diff --git a/index.html b/index.html index 7576bd7..1b95a2e 100644 --- a/index.html +++ b/index.html @@ -237,7 +237,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"options":{"read-only":"false","warning":"true","fig-width":7,"dpi":72,"message":"true","results":"markup","context":"interactive","out-height":"","out-width":"700px","autorun":"","label":"","comment":"","fig-height":5,"output":"true","classes":"","fig-cap":""},"id":1,"code":"# Welcome to Python!\n\nprint(\"Hello, Quarto-Pyodide!\")\nprint(\"You've just entered the world of Python programming.\")\n\n# Let's make a graph\nimport matplotlib.pyplot as plt\nplt.plot([1, 2, 3, 4], [1, 4, 9, 16])\nplt.ylabel('Magic Numbers')\nplt.show()\n\n# Feel free to add your own code below and have fun with Python!"}]; +globalThis.qpyodideCellDetails = [{"id":1,"code":"# Welcome to Python!\n\nprint(\"Hello, Quarto-Pyodide!\")\nprint(\"You've just entered the world of Python programming.\")\n\n# Let's make a graph\nimport matplotlib.pyplot as plt\nplt.plot([1, 2, 3, 4], [1, 4, 9, 16])\nplt.ylabel('Magic Numbers')\nplt.show()\n\n# Feel free to add your own code below and have fun with Python!","options":{"results":"markup","message":"true","dpi":72,"fig-width":7,"context":"interactive","warning":"true","fig-cap":"","read-only":"false","comment":"","label":"","output":"true","out-width":"700px","classes":"","out-height":"","fig-height":5,"autorun":""}}]; diff --git a/qpyodide-code-cell-demo.html b/qpyodide-code-cell-demo.html index ce32804..f9e8838 100644 --- a/qpyodide-code-cell-demo.html +++ b/qpyodide-code-cell-demo.html @@ -273,7 +273,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"code":"1 + 1","id":1,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"1 + 1","id":2,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"greet = 'Hello'\ngreet","id":3,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"len(greet)","id":4,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"# Try running selected code at the start of the line\nprint(\"Hello quarto-pyodide World!\")\n\n# Try highlight only -3 or 5 and pressing the keys required\n# for the \"selected code\" approach\n-3 + 5\n\n# Finally, try running the entire code cell by using Shift + ↩","id":5,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"1 + 1","id":6,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"true","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"def square(x):\n return x**2\n\nsquare(8)","id":7,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"num_list = [1, 2, 3]\n[square(num)for num in num_list]","id":8,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"import pandas as pd\n\ndf = pd.DataFrame({\n 'Name': ['JJB', 'H', 'Alex', 'Steve'],\n 'Age': [18, 25, 33, 42]\n})\n\ndf","id":9,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"import pandas as pd \n\ndf.Age","id":10,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"await micropip.install([\n \"palmerpenguins\",\n \"setuptools\" # dependency\n])","id":11,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"# Core pyodide Python package\nimport pandas as pd\n\n# External Python package\nfrom palmerpenguins import load_penguins\n\n# Load data in the package\npenguins = load_penguins()\n\n# Display th e first 5 rows of the data using Pandas\npenguins.head()","id":12,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}},{"code":"import matplotlib.pyplot as plt\n\nx = [1, 5, 3, -2]\ny = [-5, 8, 9, 4]\n\nplt.plot(x, y)\nplt.show()","id":13,"options":{"message":"true","out-width":"700px","fig-cap":"","output":"true","classes":"","context":"interactive","comment":"","read-only":"false","fig-width":7,"autorun":"","results":"markup","label":"","dpi":72,"fig-height":5,"out-height":"","warning":"true"}}]; +globalThis.qpyodideCellDetails = [{"id":1,"code":"1 + 1","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":2,"code":"1 + 1","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":3,"code":"greet = 'Hello'\ngreet","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":4,"code":"len(greet)","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":5,"code":"# Try running selected code at the start of the line\nprint(\"Hello quarto-pyodide World!\")\n\n# Try highlight only -3 or 5 and pressing the keys required\n# for the \"selected code\" approach\n-3 + 5\n\n# Finally, try running the entire code cell by using Shift + ↩","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":6,"code":"1 + 1","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"true","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":7,"code":"def square(x):\n return x**2\n\nsquare(8)","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":8,"code":"num_list = [1, 2, 3]\n[square(num)for num in num_list]","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":9,"code":"import pandas as pd\n\ndf = pd.DataFrame({\n 'Name': ['JJB', 'H', 'Alex', 'Steve'],\n 'Age': [18, 25, 33, 42]\n})\n\ndf","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":10,"code":"import pandas as pd \n\ndf.Age","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":11,"code":"await micropip.install(\"seaborn\")","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":12,"code":"# External Python package\nimport seaborn as sns\n\n# Core Pyodide packages\nimport numpy as np \nimport pandas as pd \n\ndata = np.random.multivariate_normal([0, 0], [[5, 2], [2, 2]], size=2000)\ndata = pd.DataFrame(data, columns=['x', 'y'])\n\nsns.displot(data['x']);","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}},{"id":13,"code":"import matplotlib.pyplot as plt\n\nx = [1, 5, 3, -2]\ny = [-5, 8, 9, 4]\n\nplt.plot(x, y)\nplt.show()","options":{"out-height":"","output":"true","label":"","message":"true","fig-cap":"","fig-width":7,"context":"interactive","read-only":"false","warning":"true","results":"markup","classes":"","comment":"","fig-height":5,"dpi":72,"out-width":"700px","autorun":""}}]; @@ -771,7 +771,7 @@

Load a package

Loading non-core Pyodide Python Packages

In the above example, everything just worked as pandas in available as part of Pyodide’s built-in packages. However, if we need a package that is not part of the built-in list, then there either needs to be a pure Python wheel (no compiled code present) or a specially compiled version of the Package for Python.

-

In this case, we can install the palmerpenguins package from PyPI with:

+

In this case, we can install the seaborn package from PyPI with:

Then, we have:

diff --git a/qpyodide-first-steps.html b/qpyodide-first-steps.html index 402b93a..916126b 100644 --- a/qpyodide-first-steps.html +++ b/qpyodide-first-steps.html @@ -273,7 +273,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"options":{"message":"true","context":"interactive","output":"true","out-width":"700px","fig-cap":"","dpi":72,"autorun":"","read-only":"false","warning":"true","comment":"","fig-height":5,"classes":"","results":"markup","fig-width":7,"label":"","out-height":""},"id":1,"code":"n = 5\nwhile n > 0:\n print(n)\n n = n - 1\n\nprint('Blastoff!')"}]; +globalThis.qpyodideCellDetails = [{"code":"n = 5\nwhile n > 0:\n print(n)\n n = n - 1\n\nprint('Blastoff!')","id":1,"options":{"fig-height":5,"classes":"","warning":"true","message":"true","comment":"","results":"markup","label":"","out-height":"","dpi":72,"context":"interactive","read-only":"false","output":"true","fig-cap":"","fig-width":7,"out-width":"700px","autorun":""}}]; diff --git a/search.json b/search.json index 31379f1..460fb97 100644 --- a/search.json +++ b/search.json @@ -315,7 +315,7 @@ "href": "qpyodide-code-cell-demo.html#load-a-package", "title": "Python Interactive Code Cells", "section": "Load a package", - "text": "Load a package\nWe’ve enabled dynamic package detection to handle importing packages into the environment. The dynamic part comes from detecting whether a non-core Python package is used, installing, and, then, importing it.\n\n\n\n\n\n\nNote\n\n\n\nImporting a package for the first time will require more time. Subsequent import statements will be resolve quicker.\n\n\n\nPlease enable JavaScript to experience the dynamic code cell content on this page.\n\nPlease enable JavaScript to experience the dynamic code cell content on this page.\n\nLoading non-core Pyodide Python Packages\nIn the above example, everything just worked as pandas in available as part of Pyodide’s built-in packages. However, if we need a package that is not part of the built-in list, then there either needs to be a pure Python wheel (no compiled code present) or a specially compiled version of the Package for Python.\nIn this case, we can install the palmerpenguins package from PyPI with:\n\nPlease enable JavaScript to experience the dynamic code cell content on this page.\nThen, we have:\n\nPlease enable JavaScript to experience the dynamic code cell content on this page.", + "text": "Load a package\nWe’ve enabled dynamic package detection to handle importing packages into the environment. The dynamic part comes from detecting whether a non-core Python package is used, installing, and, then, importing it.\n\n\n\n\n\n\nNote\n\n\n\nImporting a package for the first time will require more time. Subsequent import statements will be resolve quicker.\n\n\n\nPlease enable JavaScript to experience the dynamic code cell content on this page.\n\nPlease enable JavaScript to experience the dynamic code cell content on this page.\n\nLoading non-core Pyodide Python Packages\nIn the above example, everything just worked as pandas in available as part of Pyodide’s built-in packages. However, if we need a package that is not part of the built-in list, then there either needs to be a pure Python wheel (no compiled code present) or a specially compiled version of the Package for Python.\nIn this case, we can install the seaborn package from PyPI with:\n\nPlease enable JavaScript to experience the dynamic code cell content on this page.\nThen, we have:\n\nPlease enable JavaScript to experience the dynamic code cell content on this page.", "crumbs": [ "Demos", "Pyodide Interactive Cell Demo" diff --git a/tests/index.html b/tests/index.html index bd199b6..793b110 100644 --- a/tests/index.html +++ b/tests/index.html @@ -228,7 +228,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"options":{"output":"true","message":"true","read-only":"false","autorun":"","comment":"","classes":"","out-width":"700px","fig-width":7,"warning":"true","out-height":"","context":"interactive","dpi":72,"fig-height":5,"fig-cap":"","label":"","results":"markup"},"id":1,"code":"print(\"Welcome to behind the scenes of quarto-pyodide!\")"}]; +globalThis.qpyodideCellDetails = [{"id":1,"code":"print(\"Welcome to behind the scenes of quarto-pyodide!\")","options":{"warning":"true","results":"markup","autorun":"","read-only":"false","label":"","context":"interactive","comment":"","output":"true","classes":"","dpi":72,"fig-height":5,"fig-cap":"","message":"true","out-height":"","fig-width":7,"out-width":"700px"}}]; diff --git a/tests/qpyodide-test-graphic-output.html b/tests/qpyodide-test-graphic-output.html index b2a1329..f031fe4 100644 --- a/tests/qpyodide-test-graphic-output.html +++ b/tests/qpyodide-test-graphic-output.html @@ -228,7 +228,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"id":1,"code":"import matplotlib.pyplot as plt\n\nx = [1, 5, 3, -2]\ny = [-5, 8, 9, 4]\n\nplt.plot(x, y)\nplt.show()","options":{"read-only":"false","output":"true","context":"interactive","autorun":"","fig-width":7,"out-height":"","warning":"true","fig-cap":"","results":"markup","comment":"","label":"","classes":"","dpi":72,"message":"true","out-width":"700px","fig-height":5}}]; +globalThis.qpyodideCellDetails = [{"options":{"results":"markup","fig-cap":"","fig-height":5,"read-only":"false","context":"interactive","warning":"true","message":"true","out-height":"","dpi":72,"autorun":"","out-width":"700px","comment":"","label":"","classes":"","fig-width":7,"output":"true"},"code":"import matplotlib.pyplot as plt\n\nx = [1, 5, 3, -2]\ny = [-5, 8, 9, 4]\n\nplt.plot(x, y)\nplt.show()","id":1}]; diff --git a/tests/qpyodide-test-internal-cell.html b/tests/qpyodide-test-internal-cell.html index d05356a..79ae4a8 100644 --- a/tests/qpyodide-test-internal-cell.html +++ b/tests/qpyodide-test-internal-cell.html @@ -228,7 +228,7 @@ } // Store cell data -globalThis.qpyodideCellDetails = [{"id":1,"options":{"read-only":"false","results":"markup","classes":"","warning":"true","context":"interactive","out-width":"700px","autorun":"","fig-width":7,"message":"true","dpi":72,"fig-cap":"","output":"true","out-height":"","fig-height":5,"label":"","comment":""},"code":"1 + 1"},{"id":2,"options":{"read-only":"true","results":"markup","classes":"","warning":"true","context":"interactive","out-width":"700px","autorun":"","fig-width":7,"message":"true","dpi":72,"fig-cap":"","output":"true","out-height":"","fig-height":5,"label":"","comment":""},"code":"1 + 1"},{"id":3,"options":{"read-only":"false","results":"markup","classes":"","warning":"true","context":"setup","out-width":"700px","autorun":"","fig-width":7,"message":"true","dpi":72,"fig-cap":"","output":"true","out-height":"","fig-height":5,"label":"","comment":""},"code":"x = [1, 5, 3, -2]\ny = [-5, 8, 9, 4]"},{"id":4,"options":{"read-only":"false","results":"markup","classes":"","warning":"true","context":"output","out-width":"700px","autorun":"","fig-width":7,"message":"true","dpi":72,"fig-cap":"","output":"true","out-height":"","fig-height":5,"label":"","comment":""},"code":"import matplotlib.pyplot as plt\n\nprint(f\"x: {x}\")\n\nprint(f\"y: {y}\")\n\nplt.plot(x, y)"}]; +globalThis.qpyodideCellDetails = [{"options":{"context":"interactive","fig-height":5,"autorun":"","out-width":"700px","comment":"","fig-cap":"","warning":"true","out-height":"","classes":"","message":"true","fig-width":7,"label":"","results":"markup","dpi":72,"read-only":"false","output":"true"},"code":"1 + 1","id":1},{"options":{"context":"interactive","fig-height":5,"autorun":"","out-width":"700px","comment":"","fig-cap":"","warning":"true","out-height":"","classes":"","message":"true","fig-width":7,"label":"","results":"markup","dpi":72,"read-only":"true","output":"true"},"code":"1 + 1","id":2},{"options":{"context":"setup","fig-height":5,"autorun":"","out-width":"700px","comment":"","fig-cap":"","warning":"true","out-height":"","classes":"","message":"true","fig-width":7,"label":"","results":"markup","dpi":72,"read-only":"false","output":"true"},"code":"x = [1, 5, 3, -2]\ny = [-5, 8, 9, 4]","id":3},{"options":{"context":"output","fig-height":5,"autorun":"","out-width":"700px","comment":"","fig-cap":"","warning":"true","out-height":"","classes":"","message":"true","fig-width":7,"label":"","results":"markup","dpi":72,"read-only":"false","output":"true"},"code":"import matplotlib.pyplot as plt\n\nprint(f\"x: {x}\")\n\nprint(f\"y: {y}\")\n\nplt.plot(x, y)","id":4}];