Skip to content

Examples added to the docs#244

Merged
quaquel merged 6 commits intomasterfrom
examples_docs
Apr 7, 2023
Merged

Examples added to the docs#244
quaquel merged 6 commits intomasterfrom
examples_docs

Conversation

@quaquel
Copy link
Copy Markdown
Owner

@quaquel quaquel commented Apr 4, 2023

This pull request adds the examples from the examples folder to the documentation. See https://emaworkbench.readthedocs.io/en/examples_docs/examples.html for an overview.

As part of this, I have also renamed all examples to follow a consistent pattern making it easier to find specific examples.

quaquel added 3 commits April 3, 2023 21:03
autogenerate literal include docs for all examples. The code is self maintaining: if examples are removed or added the docs are also updated.
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@quaquel quaquel requested a review from EwoutH April 4, 2023 11:58
@quaquel quaquel added this to the 2.4.0 milestone Apr 4, 2023
@quaquel quaquel added the docs label Apr 4, 2023
@quaquel quaquel self-assigned this Apr 4, 2023
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 5, 2023

Coverage Status

Coverage: 81.227%. Remained the same when pulling 47a7e39 on examples_docs into 17fc315 on master.

Copy link
Copy Markdown
Collaborator

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review, missed the notification.

One minor comment: Can we split the .py files from the Jupyter Notebooks on the Examples page? It would be nice if the notebooks were listed under their own heading, since they also offer more explanation and such.

@@ -0,0 +1,110 @@
# Changelog
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is adding this changelog.md an intended change?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happens as part of the built process of the docs. While working on it, I tested it locally, hence the updated file. In principle, it can be removed.

@quaquel
Copy link
Copy Markdown
Owner Author

quaquel commented Apr 6, 2023

I use the glob directive to create the index on examples.rst. Glob is quite restrictive. The only way to do something like you suggest is to separate the examples into a notebooks folder and .py folder.

fn = os.path.join(HERE, "examples", entry)
os.remove(fn)

notebooks = glob.glob(examples_folder + "/*.ipynb")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're already collecting notebooks here separately. Isn't it possible to put them under an separate header?

Copy link
Copy Markdown
Owner Author

@quaquel quaquel Apr 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is always possible of course. It requires, however, using yet another string template just as I do for generating all .rst files for the examples. I'll take a look today.

by the way, I was referring to the sphinx glob directive as used here: https://github.com/quaquel/EMAworkbench/blob/examples_docs/docs/source/examples.rst

@EwoutH
Copy link
Copy Markdown
Collaborator

EwoutH commented Apr 7, 2023

Thanks, while I think having them listed a under separate headers would be nicer, it's a good first iteration for now and way better then not having them listed at all. If you can figure out how to put them in separate lists that would be awesome, if not feel free to merge (I recommend squashing) as it is.

@quaquel
Copy link
Copy Markdown
Owner Author

quaquel commented Apr 7, 2023

Turned out to be relatively straightforward in the end: https://emaworkbench--244.org.readthedocs.build/en/244/examples.html. And I agree: this looks much cleaner.

@quaquel quaquel merged commit 081b41f into master Apr 7, 2023
@quaquel quaquel deleted the examples_docs branch April 7, 2023 18:36
@EwoutH
Copy link
Copy Markdown
Collaborator

EwoutH commented Apr 7, 2023

Awesome work, this indeed looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants