Skip to content

Commit

Permalink
Deploying to gh-pages from @ e6e3521 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudo-rnd-thoughts committed Jan 8, 2025
1 parent 5a6afcc commit 608279e
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion main/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: b266f1c2709afd65e160ff915ff870ff
config: 9cbf5091826220aacf7cab726d53aa85
tags: d77d1c0d9ca2f4c8421862c7c5a0d620
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.20"
"version": "3.9.21"
}
},
"nbformat": 4,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.20"
"version": "3.9.21"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.20"
"version": "3.9.21"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.20"
"version": "3.9.21"
}
},
"nbformat": 4,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.20"
"version": "3.9.21"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.20"
"version": "3.9.21"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.20"
"version": "3.9.21"
}
},
"nbformat": 4,
Expand Down
15 changes: 12 additions & 3 deletions main/_modules/gymnasium/wrappers/stateful_observation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,18 @@ <h1>Source code for gymnasium.wrappers.stateful_observation</h1><div class="high
<span class="k">if</span> <span class="n">env</span><span class="o">.</span><span class="n">spec</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">env</span><span class="o">.</span><span class="n">spec</span><span class="o">.</span><span class="n">max_episode_steps</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">max_timesteps</span> <span class="o">=</span> <span class="n">env</span><span class="o">.</span><span class="n">spec</span><span class="o">.</span><span class="n">max_episode_steps</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="s2">&quot;The environment must be wrapped by a TimeLimit wrapper or the spec specify a `max_episode_steps`.&quot;</span>
<span class="p">)</span>
<span class="c1"># else we need to loop through the environment stack to check if a `TimeLimit` wrapper exists</span>
<span class="n">wrapped_env</span> <span class="o">=</span> <span class="n">env</span>
<span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">wrapped_env</span><span class="p">,</span> <span class="n">gym</span><span class="o">.</span><span class="n">Wrapper</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">wrapped_env</span><span class="p">,</span> <span class="n">gym</span><span class="o">.</span><span class="n">wrappers</span><span class="o">.</span><span class="n">TimeLimit</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">max_timesteps</span> <span class="o">=</span> <span class="n">wrapped_env</span><span class="o">.</span><span class="n">_max_episode_steps</span>
<span class="k">break</span>
<span class="n">wrapped_env</span> <span class="o">=</span> <span class="n">wrapped_env</span><span class="o">.</span><span class="n">env</span>

<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">wrapped_env</span><span class="p">,</span> <span class="n">gym</span><span class="o">.</span><span class="n">wrappers</span><span class="o">.</span><span class="n">TimeLimit</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="s2">&quot;The environment must be wrapped by a TimeLimit wrapper or the spec specify a `max_episode_steps`.&quot;</span>
<span class="p">)</span>

<span class="bp">self</span><span class="o">.</span><span class="n">timesteps</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">0</span>

Expand Down

0 comments on commit 608279e

Please sign in to comment.