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

Update docs to incorporate POMDPExamples and POMDPGallery #539

Merged
merged 14 commits into from
Mar 2, 2024

Conversation

dylan-asmar
Copy link
Member

I have updated the documentation to incorporate the content from POMDPExamples.jl and POMDPGallery.jl.

I tried to use @example blocks so the examples and gallery images should be generated during the generation of the documentation. The idea here was to have up-to-date examples each time the documentation was generated. It also adds another layer of implicit tests as the examples and gallery use various portions of the interface.

I followed the Examples and Gallery repos closely, with deviations when there appeared to be redundant information already in the documentation somewhere.

Of note, I did not include ContinuumWorld, LaserTag, or VDPTag2 in the gallery section due to problems/issues with those repositories.

I also did not include the notebooks referenced in the "Legacy tutorials" section of POMDPExamples.jl.

Issues this PR addresses:

@dylan-asmar
Copy link
Member Author

dylan-asmar commented Jan 27, 2024

Preview of the docs: https://juliapomdp.github.io/POMDPs.jl/previews/PR539/

@mykelk @mossr @zsunberg , any suggested changes/updates?

dylan-asmar and others added 3 commits January 29, 2024 20:54
* Removed Tag note
* updated using statements in gallery examples
* Got backend GR to work for Tag by adding Plots in setup
Copy link
Member

@zsunberg zsunberg left a comment

Choose a reason for hiding this comment

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

Wow @dylan-asmar thanks so much for this huge contribution! I apologize for taking so long to look at it. My travel this week put me behind on email.

I wasn't able to look at it super closely, but it looked good for the most part. I added a couple comments inline, but I have one big question: does all of the code get run in the doctests? it will be much easier to maintain if that is the case!

Also, we can tag a new +docs version - let me know if you have trouble figuring that out.

@@ -89,17 +89,15 @@ end
println("Undiscounted reward was $rsum.")
```

For more examples with visualization, see the documentation below and [POMDPGallery.jl](https://github.com/JuliaPOMDP/POMDPGallery.jl).
For more examples and examples with visualizations, reference the [Examples](https://JuliaPOMDP.github.io/POMDPs.jl/latest/examples) and [Gallery of POMDPs.jl Problems](https://JuliaPOMDP.github.io/POMDPs.jl/latest/gallery) sections of the documentaiton.
Copy link
Member

@zsunberg zsunberg Feb 12, 2024

Choose a reason for hiding this comment

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

I think there is a better way to make these links relative - maybe [Examples](/examples) or something. We don't really want to always point to a hand coded url and the latest version.

Copy link
Member Author

Choose a reason for hiding this comment

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

I know you can make relative links in the documentation. I wasn't aware you could do it from the README.md to the documentation. I'll look into that. I agree that it would be the better way to go.

Copy link
Member

Choose a reason for hiding this comment

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

Is this redundant with the defining a POMDP example file above?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes and kind of no. I included some more details in a follow-up comment.

@dylan-asmar
Copy link
Member Author

All of the examples and code are run within the documentation pipeline. I didn't structure them using jldoctest, but used @example blocks (julia documentation link). I initially thought to use jldoctest, but I didn't think matching the expected output exactly was as important as showing working examples that stay up to date (or cause an error if something breaks). As far as maintainability, it should be rather minimal as the @example blocks evaluate the code and inserts the result into the documentation.

Right now, I use the POMDPs generated in the "Defining a POMDP" section later in the documentation (solvers and simulation examples). Ideally, we could just use the code directly. However, since they are on different pages, I didn't find a way to build upon the code executed from another page.

According to the @example documentation:

By default @example blocks are run in their own anonymous Modules to avoid side-effects between blocks. To share the same module between different blocks on a page the @example can be named with the following syntax ...

Thus the way to work around this was to include crying_baby_examples.jl and crying_baby_solvers.jl in the examples directory and then call them as a setup block for @example blocks later on the same page. This unfortunately results in the requirement that any updates to the defining a POMDP code or solvers code (unlikely for the latter) require an update to the supporting files (crying_baby_example.jl and/or crying_baby_solvers.jl).

I wasn't sure how, but if we could pull code directly into the documentation in an @example or jldoctest block, then we could reduce the redundant code. Another option might be to save these supporting files real-time when the blocks are executed. However, both of these ideas would require a bit more time (that I didn't have) to research on how to do it properly.

@zsunberg
Copy link
Member

zsunberg commented Mar 2, 2024

Sorry for the delay. This semester is crazy for me! This is great - thank you so much @dylan-asmar , this is a huge contribution.

@zsunberg zsunberg merged commit e6a163f into master Mar 2, 2024
15 checks passed
@zsunberg zsunberg deleted the docs_update branch March 2, 2024 00:12
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

Successfully merging this pull request may close these issues.

Move simulation examples from POMDPExamples to main documentation The documentation is scattered
2 participants