Skip to content

Instantly share code, notes, and snippets.

@usmcamp0811
Last active February 22, 2019 00:56
Show Gist options
  • Save usmcamp0811/78cc7fb369a3ba3a19d6ea2ab515733c to your computer and use it in GitHub Desktop.
Save usmcamp0811/78cc7fb369a3ba3a19d6ea2ab515733c to your computer and use it in GitHub Desktop.
An attempt at getting papermill to work with Julia Notebooks.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true,
"tags": [
"parameter"
]
},
"outputs": [
{
"data": {
"text/plain": [
"100"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Parameters\n",
"say = \"hello world\"\n",
"plot_size = 100"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"hello world\n"
]
}
],
"source": [
"println(say)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip8000\">\n",
" <rect x=\"0\" y=\"0\" width=\"2000\" height=\"2000\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<defs>\n",
" <clipPath id=\"clip8001\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip8001)\" points=\"\n",
"0,1600 2400,1600 2400,0 0,0 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip8002\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip8001)\" points=\"\n",
"188.156,1503.47 2321.26,1503.47 2321.26,47.2441 188.156,47.2441 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip8003\">\n",
" <rect x=\"188\" y=\"47\" width=\"2134\" height=\"1457\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 228.2,1503.47 228.2,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 736.373,1503.47 736.373,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1244.54,1503.47 1244.54,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1752.72,1503.47 1752.72,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 2260.89,1503.47 2260.89,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 188.156,1497.09 2321.26,1497.09 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 188.156,1143.53 2321.26,1143.53 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 188.156,789.972 2321.26,789.972 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 188.156,436.414 2321.26,436.414 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 188.156,82.8555 2321.26,82.8555 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 188.156,1503.47 2321.26,1503.47 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 188.156,1503.47 188.156,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 228.2,1503.47 228.2,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 736.373,1503.47 736.373,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1244.54,1503.47 1244.54,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1752.72,1503.47 1752.72,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 2260.89,1503.47 2260.89,1481.63 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 188.156,1497.09 220.153,1497.09 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 188.156,1143.53 220.153,1143.53 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 188.156,789.972 220.153,789.972 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 188.156,436.414 220.153,436.414 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 188.156,82.8555 220.153,82.8555 \n",
" \"/>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 228.2, 1557.47)\" x=\"228.2\" y=\"1557.47\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 736.373, 1557.47)\" x=\"736.373\" y=\"1557.47\">25</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1244.54, 1557.47)\" x=\"1244.54\" y=\"1557.47\">50</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1752.72, 1557.47)\" x=\"1752.72\" y=\"1557.47\">75</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2260.89, 1557.47)\" x=\"2260.89\" y=\"1557.47\">100</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 164.156, 1514.59)\" x=\"164.156\" y=\"1514.59\">0.00</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 164.156, 1161.03)\" x=\"164.156\" y=\"1161.03\">0.25</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 164.156, 807.472)\" x=\"164.156\" y=\"807.472\">0.50</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 164.156, 453.914)\" x=\"164.156\" y=\"453.914\">0.75</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 164.156, 100.356)\" x=\"164.156\" y=\"100.356\">1.00</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip8003)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 248.527,760.213 268.854,1319.72 289.181,950.252 309.508,160.633 329.835,426.865 350.162,757.93 370.489,1238.93 390.815,1462.26 411.142,572.157 431.469,768.756 \n",
" 451.796,1164.5 472.123,1312.87 492.45,809.432 512.777,1307.69 533.104,539.041 553.431,968.585 573.757,1348.03 594.084,771.947 614.411,833.808 634.738,1054.64 \n",
" 655.065,1095.51 675.392,1214.16 695.719,1139.79 716.046,872.333 736.373,1441.89 756.699,144.428 777.026,254.285 797.353,1006.44 817.68,1019.12 838.007,404.282 \n",
" 858.334,681.534 878.661,1300.81 898.988,997.872 919.314,635.584 939.641,567.159 959.968,189.82 980.295,910.443 1000.62,1065.46 1020.95,1049.33 1041.28,1424.46 \n",
" 1061.6,386.673 1081.93,176.302 1102.26,806.46 1122.58,988.424 1142.91,529.95 1163.24,1276.57 1183.56,577.305 1203.89,1117.46 1224.22,718.87 1244.54,1427.5 \n",
" 1264.87,530.887 1285.2,564.724 1305.53,535.109 1325.85,1139.61 1346.18,1436.52 1366.51,592.413 1386.83,972.131 1407.16,1444.06 1427.49,408.1 1447.81,873.924 \n",
" 1468.14,265.184 1488.47,1004.71 1508.79,1137.69 1529.12,1258.15 1549.45,985.715 1569.77,471.865 1590.1,1200.83 1610.43,1277.14 1630.76,1366.64 1651.08,259.14 \n",
" 1671.41,1235.11 1691.74,130.868 1712.06,406.366 1732.39,1120.99 1752.72,480.281 1773.04,543.226 1793.37,632.866 1813.7,454.332 1834.02,449.618 1854.35,583.213 \n",
" 1874.68,838.753 1895.01,1298.33 1915.33,882.991 1935.66,195.529 1955.99,307.277 1976.31,950.231 1996.64,265.889 2016.97,358.257 2037.29,330.594 2057.62,368.745 \n",
" 2077.95,1283.62 2098.27,1383.91 2118.6,131.611 2138.93,290.987 2159.25,408.429 2179.58,401.432 2199.91,1374.35 2220.24,1273.62 2240.56,683.818 2260.89,88.4582 \n",
" \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip8001)\" points=\"\n",
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip8001)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1982.43,191.244 2126.43,191.244 \n",
" \"/>\n",
"<g clip-path=\"url(#clip8001)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
"</g>\n",
"</svg>\n"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"using Plots\n",
"\n",
"plot(1:plot_size, rand(plot_size))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Julia 1.1.0",
"language": "julia",
"name": "julia-1.1"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.1.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
# the command used to get these results
papermill input.ipynb output.ipynb -p say "this was a test" -p plot_size 932
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment