Skip to content

Commit 24a6384

Browse files
ernestumAdamGleave
andauthored
Fix documentation pipeline (#827)
* Split GAIL tutorial into more cells to evade cell timout issues. * Increase notebook cell execution timeout. * Rename readthedocs.yaml to official hidden name. * Add parallel requirements to docs requirements. * Add missing hypothesis requirement to doc requirements. * Fix typo --------- Co-authored-by: Adam Gleave <adam@gleave.me>
1 parent 629ef9a commit 24a6384

File tree

4 files changed

+71
-21
lines changed

4 files changed

+71
-21
lines changed

readthedocs.yml .readthedocs.yml

File renamed without changes.

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
autosummary_generate = True
5656

5757
nb_execution_mode = os.getenv("NB_EXECUTION_MODE", "cache")
58-
nb_execution_timeout = 120
58+
nb_execution_timeout = 200
5959
nb_merge_streams = True
6060
nb_output_stderr = "remove"
6161
nb_execution_raise_on_error = True

docs/tutorials/3_train_gail.ipynb

+51-8
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@
7878
"source": [
7979
"Now we are ready to set up our GAIL trainer.\n",
8080
"Note, that the `reward_net` is actually the network of the discriminator.\n",
81-
"We evaluate the learner before and after training so we can see if it made any progress."
81+
"We evaluate the learner before and after training so we can see if it made any progress.\n",
82+
"\n",
83+
"First we construct a GAIL trainer ..."
8284
]
8385
},
8486
{
@@ -117,16 +119,57 @@
117119
" venv=env,\n",
118120
" gen_algo=learner,\n",
119121
" reward_net=reward_net,\n",
120-
")\n",
121-
"\n",
122-
"# evaluate the learner before training\n",
122+
")"
123+
]
124+
},
125+
{
126+
"cell_type": "markdown",
127+
"metadata": {},
128+
"source": [
129+
"... then we evaluate it before training ..."
130+
]
131+
},
132+
{
133+
"cell_type": "code",
134+
"execution_count": null,
135+
"metadata": {},
136+
"outputs": [],
137+
"source": [
123138
"env.seed(SEED)\n",
124139
"learner_rewards_before_training, _ = evaluate_policy(\n",
125140
" learner, env, 100, return_episode_rewards=True\n",
126-
")\n",
127-
"\n",
128-
"# train the learner and evaluate again\n",
129-
"gail_trainer.train(200_000)\n",
141+
")"
142+
]
143+
},
144+
{
145+
"cell_type": "markdown",
146+
"metadata": {},
147+
"source": [
148+
"... and train it ..."
149+
]
150+
},
151+
{
152+
"cell_type": "code",
153+
"execution_count": null,
154+
"metadata": {},
155+
"outputs": [],
156+
"source": [
157+
"gail_trainer.train(200_000)"
158+
]
159+
},
160+
{
161+
"cell_type": "markdown",
162+
"metadata": {},
163+
"source": [
164+
"... and finally evaluate it again."
165+
]
166+
},
167+
{
168+
"cell_type": "code",
169+
"execution_count": null,
170+
"metadata": {},
171+
"outputs": [],
172+
"source": [
130173
"env.seed(SEED)\n",
131174
"learner_rewards_after_training, _ = evaluate_policy(\n",
132175
" learner, env, 100, return_episode_rewards=True\n",

setup.py

+19-12
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
]
2020
PYTYPE = ["pytype==2023.9.27"] if IS_NOT_WINDOWS else []
2121

22+
HYPOTHESIS = ["hypothesis~=6.54.1"]
23+
2224
# Note: the versions of the test and doc requirements should be tightly pinned to known
2325
# working versions to make our CI/CD pipeline as stable as possible.
2426
TESTS_REQUIRE = (
@@ -36,7 +38,6 @@
3638
"flake8-debugger~=4.1.2",
3739
"flake8-docstrings~=1.6.0",
3840
"flake8-isort~=4.1.2",
39-
"hypothesis~=6.54.1",
4041
"ipykernel~=6.15.1",
4142
"jupyter~=1.0.0",
4243
# TODO: upgrade jupyter-client once
@@ -58,18 +59,24 @@
5859
+ PARALLEL_REQUIRE
5960
+ ATARI_REQUIRE
6061
+ PYTYPE
62+
+ HYPOTHESIS
63+
)
64+
DOCS_REQUIRE = (
65+
[
66+
"sphinx~=5.1.1",
67+
"sphinx-autodoc-typehints~=1.19.1",
68+
"sphinx-rtd-theme~=1.0.0",
69+
"sphinxcontrib-napoleon==0.7",
70+
"furo==2022.6.21",
71+
"sphinx-copybutton==0.5.0",
72+
"sphinx-github-changelog~=1.2.0",
73+
"myst-nb==0.17.2",
74+
"ipykernel~=6.15.2",
75+
]
76+
+ ATARI_REQUIRE
77+
+ PARALLEL_REQUIRE
78+
+ HYPOTHESIS
6179
)
62-
DOCS_REQUIRE = [
63-
"sphinx~=5.1.1",
64-
"sphinx-autodoc-typehints~=1.19.1",
65-
"sphinx-rtd-theme~=1.0.0",
66-
"sphinxcontrib-napoleon==0.7",
67-
"furo==2022.6.21",
68-
"sphinx-copybutton==0.5.0",
69-
"sphinx-github-changelog~=1.2.0",
70-
"myst-nb==0.17.2",
71-
"ipykernel~=6.15.2",
72-
] + ATARI_REQUIRE
7380

7481

7582
def get_readme() -> str:

0 commit comments

Comments
 (0)