-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic sphinx-gallery example (#44)
Summary: This PR adds a basic example of an... example. The examples are created with the sphinx-gallery extension and allow us to write notebook-style code. The current one is very basic and looks like this: ![screen](https://github.com/pytorch-labs/torchcodec/assets/1190450/322fef23-059f-4733-91e1-3cc60722ed19) Pull Request resolved: #44 Reviewed By: scotts Differential Revision: D58810557 Pulled By: NicolasHug fbshipit-source-id: 72d689d3b264a8a2cae4a1bc87753754f1b272bf
- Loading branch information
1 parent
e6a72d5
commit a2ee580
Showing
9 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. _gallery: | ||
|
||
Examples and tutorials | ||
====================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
============= | ||
Basic Example | ||
============= | ||
Remove this! | ||
""" | ||
|
||
# %% | ||
print("This is a cell that gets executerd") | ||
# %% | ||
print("And another cell.") | ||
|
||
# %% | ||
# We can write rst cells too! | ||
# --------------------------- | ||
# | ||
# As if we're writing normal docs/docstrings. Let's reference the | ||
# :class:`~torchcodec.decoders.SimpleVideoDecoder` class. Click on this and it | ||
# should bring you to its docstring!! In the docstring, you should see a | ||
# backreference to this example as well! | ||
# | ||
# And of course we can write normal code | ||
|
||
# %% | ||
from torchcodec.decoders import SimpleVideoDecoder | ||
|
||
try: | ||
SimpleVideoDecoder("bad_path") | ||
except ValueError as e: | ||
print(f"Ooops:\n {e}") | ||
|
||
# %% | ||
print("All good!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters