Skip to content

[experiment] mucking around with sphinx gallery #2796

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

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .ci/docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Refer to ./jenkins/build.sh for tutorial build instructions

sphinx==5.3.0
sphinx-gallery==0.11.1
sphinx-gallery==0.17.1
sphinx-reredirects==0.1.4
sphinx-design==0.4.0
docutils==0.16
Expand Down Expand Up @@ -31,7 +31,8 @@ pytorch-lightning
torchx
torchrl==0.7.2
tensordict==0.7.2
ax-platform>=0.4.0
# For ax_multiobjective_nas_tutorial.py
ax-platform>=0.4.0,<0.5.0
nbformat>=5.9.2
datasets
transformers
Expand Down
4 changes: 2 additions & 2 deletions .jenkins/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ elif [[ "${JOB_TYPE}" == "manager" ]]; then
if [[ "$COMMIT_SOURCE" == "refs/heads/master" || "$COMMIT_SOURCE" == "refs/heads/main" ]]; then
git clone https://github.com/pytorch/tutorials.git -b gh-pages gh-pages
# Clean up directories that contain tutorials

for dir in beginner intermediate prototype recipes advanced distributed vision text audio; do
rm -rf "gh-pages/$dir"
done

cp -r docs/* gh-pages/
pushd gh-pages
# DANGER! DO NOT REMOVE THE `set +x` SETTING HERE!
Expand Down
3 changes: 2 additions & 1 deletion custom_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def run(self):
if 'intro' in self.options:
intro = self.options['intro'][:195] + '...'
else:
_, blocks = sphinx_gallery.gen_rst.split_code_and_text_blocks(abs_fname)
block_parser = sphinx_gallery.gen_rst.BlockParser(abs_fname, {"filetype_parsers": {}})
_, blocks, _ = block_parser.split_code_and_text_blocks(abs_fname)
intro, _ = sphinx_gallery.gen_rst.extract_intro_and_title(abs_fname, blocks[0][1])

thumbnail_rst = ''
Expand Down
2 changes: 1 addition & 1 deletion intermediate_source/ax_multiobjective_nas_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def _get_event_multiplexer_for_trial(self, trial):
mul = event_multiplexer.EventMultiplexer(max_reload_threads=20)
mul.AddRunsFromDirectory(Path(log_dir).joinpath(str(trial.index)).as_posix(), None)
mul.Reload()

return mul

# This indicates whether the metric is queryable while the trial is
Expand Down
Loading