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

DOC: README.md: Inline i/o from Example.ipynb #89

Closed
westurner opened this issue Feb 24, 2023 · 8 comments
Closed

DOC: README.md: Inline i/o from Example.ipynb #89

westurner opened this issue Feb 24, 2023 · 8 comments

Comments

@westurner
Copy link

Could the usage examples from Example.ipynb be inlined into the README.md?

  • https://github.com/chmp/ipytest/blob/main/Example.ipynb
  • The last time I tried to email a nb with output to a mailing list, IIRC it was easiest to pandoc --from=html --to=gfm than to try and save the input and output cells to Markdown with Jupyter nbconvert or jupytext.
    (... Why {base64 output etc} is not included in most non-.ipynb notebook representations:
@westurner
Copy link
Author

@fperez @Carreau @choldgraf @mwouts
If README.md were MyST-Markdown (e.g. as processed by executablebooks/jupyter-book), it still wouldn't have the cell outputs in the Markdown for the README, AFAIU?

@chmp
Copy link
Owner

chmp commented Mar 5, 2023

I guess in general the Readme could use a bit of a touch up and reorganization. As the Readme is quite long as-is, I am not really in favor of adding more content, though.

  • Do you have any specifc parts of the use example in mid that are missing from the Readme?
  • Or any specific information that is hard to find?

Re how to achieve this: I guess writing a custom converter would be easiest (the notebook format is quite easy to parse).

@westurner
Copy link
Author

Just that "Extended Usage" is more apidoc (see also sphinx-apidoc & jupyter-book, nbdev) than usage examples.

Maybe just bold the "example notebook" link?

@mwouts
Copy link

mwouts commented Mar 5, 2023

Hey @westurner , yes you're right in the end we never developed the text notebook format with outputs - sorry about that.

I like seeing this project about making test available in the notebook! BTW Jupyter and Pytest are probably my two favorite tools. In Pytest I write a lot of fixtures (sample data sets), do you plan to make them accessible from Jupyter ? I've always wondered what is the best way to get these data sets in Jupyter for interactive exploration when I work on a new test...

@fperez
Copy link

fperez commented Mar 6, 2023

See my note here re. recent discussion about md+outputs, I hope it's useful.

@chmp
Copy link
Owner

chmp commented Mar 6, 2023

Just that "Extended Usage" is more apidoc (see also sphinx-apidoc & jupyter-book, nbdev) than usage examples.

Maybe just bold the "example notebook" link?

@westurner That's a fair point. I will experiment a bit with rewriting the readme. Getting a bold link to the example notebook, should be doable whatever I come up with :)

I like seeing this project about making test available in the notebook! BTW Jupyter and Pytest are probably my two favorite tools. In Pytest I write a lot of fixtures (sample data sets), do you plan to make them accessible from Jupyter ? I've always wondered what is the best way to get these data sets in Jupyter for interactive exploration when I work on a new test...

@mwouts what are you exact requirements? Fixtures should already work. So far I did not run into any problems, but I guess it depends a bit your usage pattern. Example:

import ipytest
ipytest.autoconfig()

%pycat conftest.py
import pytest 

@pytest.fixture
def my_fixture():
    return 21

%%ipytest

def test_example(my_fixture):
    assert my_fixture * 2 == 42
.                                                                                            [100%]
1 passed in 0.00s

@chmp
Copy link
Owner

chmp commented Mar 28, 2023

Work on readme started in #92.

@chmp
Copy link
Owner

chmp commented Apr 6, 2023

Updated docs: simplified readme with a more prominent link to the example notebook.

@chmp chmp closed this as completed Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants