-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mirror files updated (outputs removed, metadata filtered)
- Loading branch information
Showing
18 changed files
with
243 additions
and
524 deletions.
There are no files selected for viewing
34 changes: 16 additions & 18 deletions
34
...otebooks/mirror/ipynb_to_pandoc/Notebook with function and cell metadata 164.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,43 @@ | ||
::: {.cell .code execution_count="1"} | ||
--- | ||
jupyter: | ||
kernelspec: | ||
display_name: Python 3 | ||
language: python | ||
name: python3 | ||
nbformat: 4 | ||
nbformat_minor: 2 | ||
--- | ||
|
||
::: {.cell .code} | ||
``` {.python} | ||
1 + 1 | ||
``` | ||
|
||
::: {.output .execute_result execution_count="1"} | ||
2 | ||
::: | ||
::: | ||
|
||
::: {.cell .markdown} | ||
A markdown cell And below, the cell for function f has non trivial cell | ||
metadata. And the next cell as well. | ||
A markdown cell | ||
And below, the cell for function f has non trivial cell metadata. And the next cell as well. | ||
::: | ||
|
||
::: {.cell .code execution_count="2" attributes="{"n":"10","id":"","classes":[]}"} | ||
::: {.cell .code attributes="{"n":"10","id":"","classes":[]}"} | ||
``` {.python} | ||
def f(x): | ||
return x | ||
``` | ||
::: | ||
|
||
::: {.cell .code execution_count="3" attributes="{"n":"10","id":"","classes":[]}"} | ||
::: {.cell .code attributes="{"n":"10","id":"","classes":[]}"} | ||
``` {.python} | ||
f(5) | ||
``` | ||
|
||
::: {.output .execute_result execution_count="3"} | ||
5 | ||
::: | ||
::: | ||
|
||
::: {.cell .markdown} | ||
More text | ||
::: | ||
|
||
::: {.cell .code execution_count="4"} | ||
::: {.cell .code} | ||
``` {.python} | ||
2 + 2 | ||
``` | ||
|
||
::: {.output .execute_result execution_count="4"} | ||
4 | ||
::: | ||
::: |
40 changes: 15 additions & 25 deletions
40
tests/notebooks/mirror/ipynb_to_pandoc/Notebook with html and latex cells.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,45 @@ | ||
::: {.cell .code execution_count="1"} | ||
--- | ||
jupyter: | ||
kernelspec: | ||
display_name: Python 3 | ||
language: python | ||
name: python3 | ||
nbformat: 4 | ||
nbformat_minor: 2 | ||
--- | ||
|
||
::: {.cell .code} | ||
``` {.python} | ||
%%html | ||
<p><a href="https://github.com/mwouts/jupytext", style="color: rgb(0,0,255)">Jupytext</a> on GitHub</p> | ||
``` | ||
|
||
::: {.output .display_data} | ||
<p><a href="https://github.com/mwouts/jupytext", style="color: rgb(0,0,255)">Jupytext</a> on GitHub</p> | ||
::: | ||
::: | ||
|
||
::: {.cell .code execution_count="2"} | ||
::: {.cell .code} | ||
``` {.python} | ||
%%latex | ||
$\frac{\pi}{2}$ | ||
``` | ||
|
||
::: {.output .display_data} | ||
$\frac{\pi}{2}$ | ||
::: | ||
::: | ||
|
||
::: {.cell .code execution_count="3"} | ||
::: {.cell .code} | ||
``` {.python} | ||
%load_ext rpy2.ipython | ||
``` | ||
::: | ||
|
||
::: {.cell .code execution_count="4"} | ||
::: {.cell .code} | ||
``` {.python} | ||
%%R | ||
library(ggplot2) | ||
ggplot(data=data.frame(x=c('A', 'B'), y=c(5, 2)), aes(x,weight=y)) + geom_bar() | ||
``` | ||
|
||
::: {.output .display_data} | ||
![](7f97cecde4f72e650de2f3937ac4999467e76306.png) | ||
::: | ||
::: | ||
|
||
::: {.cell .code execution_count="5"} | ||
::: {.cell .code} | ||
``` {.python} | ||
%matplotlib inline | ||
import pandas as pd | ||
pd.Series({'A':5, 'B':2}).plot(figsize=(3,2), kind='bar') | ||
``` | ||
|
||
::: {.output .execute_result execution_count="5"} | ||
<matplotlib.axes._subplots.AxesSubplot at 0x2da0c41a9e8> | ||
::: | ||
|
||
::: {.output .display_data} | ||
![](9344ac2b35133877848c9a89b2fbbcc3dcce81e0.png) | ||
::: | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 15 additions & 14 deletions
29
tests/notebooks/mirror/ipynb_to_pandoc/Notebook_with_R_magic.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,46 @@ | ||
--- | ||
jupyter: | ||
kernelspec: | ||
display_name: Python 2 | ||
language: python | ||
name: python2 | ||
nbformat: 4 | ||
nbformat_minor: 2 | ||
--- | ||
|
||
::: {.cell .markdown} | ||
# A notebook with R cells | ||
|
||
This notebook shows the use of R cells to generate plots | ||
::: | ||
|
||
::: {.cell .code execution_count="1"} | ||
::: {.cell .code} | ||
``` {.python} | ||
%load_ext rpy2.ipython | ||
``` | ||
::: | ||
|
||
::: {.cell .code execution_count="2"} | ||
::: {.cell .code} | ||
``` {.python} | ||
%%R | ||
suppressMessages(require(tidyverse)) | ||
``` | ||
::: | ||
|
||
::: {.cell .code execution_count="3"} | ||
::: {.cell .code} | ||
``` {.python} | ||
%%R | ||
ggplot(iris, aes(x = Sepal.Length, y = Petal.Length, color=Species)) + geom_point() | ||
``` | ||
|
||
::: {.output .display_data} | ||
![](3fc4493185b3637a4127483394ece754faff16c7.png) | ||
::: | ||
::: | ||
|
||
::: {.cell .markdown} | ||
The default plot dimensions are not good for us, so we use the -w and -h | ||
parameters in %%R magic to set the plot size | ||
The default plot dimensions are not good for us, so we use the -w and -h parameters in %%R magic to set the plot size | ||
::: | ||
|
||
::: {.cell .code execution_count="4"} | ||
::: {.cell .code} | ||
``` {.python} | ||
%%R -w 400 -h 240 | ||
ggplot(iris, aes(x = Sepal.Length, y = Petal.Length, color=Species)) + geom_point() | ||
``` | ||
|
||
::: {.output .display_data} | ||
![](92a00f6aa6af61f269e4b4a9db7fe31d5f8b1dbb.png) | ||
::: | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 12 additions & 8 deletions
20
tests/notebooks/mirror/ipynb_to_pandoc/convert_to_py_then_test_with_update83.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
::: {.cell .code execution_count="1" scrolled="false"} | ||
--- | ||
jupyter: | ||
kernelspec: | ||
display_name: Python 3 | ||
language: python | ||
name: python3 | ||
nbformat: 4 | ||
nbformat_minor: 2 | ||
--- | ||
|
||
::: {.cell .code} | ||
``` {.python} | ||
%%time | ||
print('asdf') | ||
``` | ||
|
||
::: {.output .stream .stdout} | ||
asdf | ||
CPU times: user 132 µs, sys: 57 µs, total: 189 µs | ||
Wall time: 188 µs | ||
::: | ||
::: | ||
|
||
::: {.cell .markdown} | ||
Thanks for jupytext! | ||
::: | ||
|
||
::: {.cell .code collapsed="true"} | ||
::: {.cell .code} | ||
``` {.python} | ||
``` | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.