-
Notifications
You must be signed in to change notification settings - Fork 65
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
link example models to readthedocs #101
Conversation
Codecov ReportBase: 79.50% // Head: 79.54% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #101 +/- ##
==========================================
+ Coverage 79.50% 79.54% +0.03%
==========================================
Files 6 6
Lines 610 611 +1
Branches 99 109 +10
==========================================
+ Hits 485 486 +1
Misses 108 108
Partials 17 17
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Does the iframe render the YouTube video correctly in RTD? Maybe we should look for a precedent in other projects. Maybe they link to a live Jupyter notebook instead of a video/GIF? |
Yes RTD renders both the gifs and the embedded YouTube videos correctly, at least on my laptop. For agents.jl, the video files are used directly in the Examples: https://juliadynamics.github.io/Agents.jl/stable/examples/schelling/, source code here. But I'm not sure whether they use RTD or not. |
I see. My vote is to use embedded YouTube via iframe. Those hundreds of KBs of GIFs will bog down the Git repo size (that collaborators will have to download them when they I couldn't find any schelling.mp4 file in Agents.jl's repo: https://github.com/JuliaDynamics/Agents.jl/search?q=schelling.mp4. |
Looks like they put everything inside the |
I see. I did complain that their repo size is huge: JuliaDynamics/Agents.jl#389 (~263 MB at the time). |
I agree, I think a smaller repo is better. We want a lean clone. This feeds to the #1406 discussion and is also a consideration for the cached results approach as we look further down the road. |
I'm more in favor of gifs, as they 1) looks nicer than embedded videos, 2) plays automatically and doesn't require Internet connection, and 3) works with both RTD and GitHub markdown. But I do admit that they do not scale: 1MB per example gif If there's no other objection I'll update this PR to use embedded YouTube videos. |
To read the page itself, wouldn't it require an Internet connection?
It seems to be possible: https://www.elliotblackburn.com/upload-gifs-to-github-gists/. But this also means we could have a projectmesa/mesa-geo-videos repo instead of GH Gist. This sounds like a viable option as well. |
You're right! 😂
In this case a mesa-geo-videos repo sounds better, since we can accept contributions through pull requests. Shall we go for this approach or stick with YouTube videos? |
I think I prefer mesa-geo-videos repo now. A Git repo is easier to replicate. And yes, enabling PR for contributions is a huge plus. |
Alright! I will update this PR to remove all gifs and use YouTube videos first. But I will keep this PR open until our monthly meeting this weekend when we discuss the examples. We can also talk about whether to have a repo to store example videos for mesa-geo. |
4334611
to
aa7b353
Compare
+1 to the direction this conversation is going |
I agree that we should not include gifs in this repository, but we should still be able to include the videos as gifs! I don't think we need to upload them to YouTube, we can just include the link to the other repo. |
@wang-boyu what's your take on this comment? JuliaDynamics/Agents.jl#389 (comment). I think the videos in Agents.jl doc are generated automatically via |
Well, that makes sense! Thank you @rht @Datseris for your input on this. Let's say we have a separate repo to store the videos. Then the workflow to add an example would need two PRs - one in On the other hand, being able to export the models as videos will be very useful (see projectmesa/mesa#885). We can try to integrate it into the doc building procedure if possible. For this PR I suggest we use YouTube videos first (since it's already done), and switch to generated videos once it's implemented. We can continue the discussion during our dev meeting. |
Yes, videos are autogenerated with this function. They are displayed via HTLM on the page. The syntax is native HTML syntax that can be included in markdown documents that Documetner.jl processes into HTML. E.g.,: https://github.com/JuliaDynamics/Agents.jl/blob/main/examples/schelling.jl#L3-L7 (Literate.jl first processes normal .jl files into markdown .md files, and then Documetner.jl processes markdown files into HTML. From our perspective as developers we simply write normal, fully runnable julia scripts which call
That's exactly why I use
In Agents.jl any model can be done into a video via the BTW my two cents: don't consider gif at all as a format and use mp4 for everything. It plays practically everywhere and requires much less MB for the same video... In what sort of documentation generation you can't show mp4 videos? |
Thank you for sharing your thoughts and those cool features from Agents.jl. They are very helpful. I (almost) want to switch from Python to Julia : ) |
This is tangent, but usually we could have a Julia backend wrapped as a Python package, so that the code is usable to the Python audience.
|
Agents.jl would certainly benefit by having more people on the dev team, as currently we are only two people making all of this work... |
aa7b353
to
d505be0
Compare
d505be0
to
498e29e
Compare
@rht shall we review and merge this PR first, instead of waiting for the vote at projectmesa/mesa#1411? I can update this repo later depending on the discussion results. |
Sounds good. |
This PR mainly links examples to Read the Docs, with a few minor fixes.
It is still a draft PR, as I am not sure whether to use videos or gifs to demonstrate our examples.
With videos:
docs/examples
folder, the other inexamples
folder.With gifs:
docs/examples
folder can simply link to that inexamples
folder without modification.To compare, the
geo_schelling
andgeo_schelling_points
examples are using gifs, while the rest are using YouTube videos. Once we agree on an approach, I will update accordingly.