-
Notifications
You must be signed in to change notification settings - Fork 386
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
Document how to test a notebook with jupytext --check
#286
Comments
Apparently |
@mattharrison, you mentioned at #220 that you would like to run May I ask if I understand correctly that you plan to use jupytext --to py notebook.md # (or notebook.ipynb)
python -m doctest notebook.py |
I have authored multiple books using rst. I enter my Python code as if it were typed at the terminal and then I can run doctest to ensure that my book "runs". I'd like to be able to do similar with Jupytext, ie write a book, but using Markdown (because I want to go back and forth from Jupyter to try things out). When writing about machine learning/data analysis, having the output is critical for readers. Here's an example from rst: How to do it…
~~~~~~~~~~~~~
.. code:: pycon
>>> pd.set_option('max_columns', 4, 'max_rows', 10)
.. code:: pycon
>>> movies = pd.read_csv('data/movie.csv')
>>> movies.head()
color director_name ... aspect_ratio movie_facebook_likes
0 Color James Cameron ... 1.78 33000
1 Color Gore Verbinski ... 2.35 0
2 Color Sam Mendes ... 2.35 85000
3 Color Christopher Nolan ... 2.35 164000
4 NaN Doug Walker ... NaN 0
<BLANKLINE>
[5 rows x 28 columns]
Realize this might be "out of scope" for jupytext, but would love to be able to get the output in markdown. :) |
I see! Thanks for the clarification, this is an interesting use case. Since Jupytext Markdown is a format for Jupyter notebooks, maybe we'll be able to do that using notebook tools rather than Precisely, I expect that, when outputs become available in Markdown, you will be able to either
|
Just a quick note for myself - some of the programs above do not accept files on stdin. So maybe we could implement a temp file facility in Jupytext, and allow one to call jupytext notebook.ipynb --check 'python -m pytest {}' |
We should provide a sample notebook with
and document how to test it with
jupytext --check [pytest]
.How does that compare to
The text was updated successfully, but these errors were encountered: