Skip to content

Commit

Permalink
Deploying to gh-pages from @ f286402 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdavey committed Apr 18, 2024
1 parent a903e26 commit a630aa3
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 45 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: a67f2055f12cba2e69c93bcbae67e3c5
config: 133da9a3f53ab218874b55ac02a96fd4
tags: d77d1c0d9ca2f4c8421862c7c5a0d620
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions main/_modules/minari/data_collector/data_collector/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,7 @@ <h1>Source code for minari.data_collector.data_collector</h1><div class="highlig
<span class="n">dict_data</span> <span class="o">=</span> <span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">step_data</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">k</span> <span class="o">!=</span> <span class="s2">&quot;infos&quot;</span><span class="p">}</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">_reference_info</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">_check_infos_same_shape</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_reference_info</span><span class="p">,</span> <span class="n">step_data</span><span class="p">[</span><span class="s2">&quot;infos&quot;</span><span class="p">]</span>
<span class="p">):</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">_check_infos_same_shape</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_reference_info</span><span class="p">,</span> <span class="n">step_data</span><span class="p">[</span><span class="s2">&quot;infos&quot;</span><span class="p">]):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="s2">&quot;Info structure inconsistent with info structure returned by original reset.&quot;</span>
<span class="p">)</span>
Expand Down Expand Up @@ -634,7 +632,7 @@ <h1>Source code for minari.data_collector.data_collector</h1><div class="highlig
<span class="bp">self</span><span class="o">.</span><span class="n">_validate_buffer</span><span class="p">()</span>
<span class="n">episode_buffer</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;seed&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span> <span class="k">if</span> <span class="n">seed</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">seed</span><span class="p">,</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_episode_id</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_episode_id</span><span class="p">,</span>
<span class="p">}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_add_step_data</span><span class="p">(</span><span class="n">episode_buffer</span><span class="p">,</span> <span class="n">step_data</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_buffer</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">episode_buffer</span><span class="p">)</span>
Expand Down Expand Up @@ -736,7 +734,7 @@ <h1>Source code for minari.data_collector.data_collector</h1><div class="highlig
<span class="c1"># will be able to calculate dataset size only after saving the disk, so updating the dataset metadata post `save_to_disk` method</span>

<span class="n">dataset</span> <span class="o">=</span> <span class="n">MinariDataset</span><span class="p">(</span><span class="n">dataset_path</span><span class="p">)</span>
<span class="n">metadata</span><span class="p">[</span><span class="s1">&#39;dataset_size&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">dataset</span><span class="o">.</span><span class="n">storage</span><span class="o">.</span><span class="n">get_size</span><span class="p">()</span>
<span class="n">metadata</span><span class="p">[</span><span class="s2">&quot;dataset_size&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">dataset</span><span class="o">.</span><span class="n">storage</span><span class="o">.</span><span class="n">get_size</span><span class="p">()</span>
<span class="n">dataset</span><span class="o">.</span><span class="n">storage</span><span class="o">.</span><span class="n">update_metadata</span><span class="p">(</span><span class="n">metadata</span><span class="p">)</span>
<span class="k">return</span> <span class="n">dataset</span>

Expand Down Expand Up @@ -804,7 +802,9 @@ <h1>Source code for minari.data_collector.data_collector</h1><div class="highlig
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">info_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="nb">dict</span><span class="p">):</span>
<span class="k">return</span> <span class="n">_check_infos_same_shape</span><span class="p">(</span><span class="n">info_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">info_2</span><span class="p">[</span><span class="n">key</span><span class="p">])</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">info_1</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">):</span>
<span class="k">return</span> <span class="p">(</span><span class="n">info_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span> <span class="o">==</span> <span class="n">info_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="n">info_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">dtype</span> <span class="o">==</span> <span class="n">info_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">dtype</span><span class="p">)</span>
<span class="k">return</span> <span class="p">(</span><span class="n">info_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span> <span class="o">==</span> <span class="n">info_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span>
<span class="n">info_1</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">dtype</span> <span class="o">==</span> <span class="n">info_2</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">dtype</span>
<span class="p">)</span>
<span class="k">return</span> <span class="kc">True</span>
</pre></div>
</article>
Expand Down
11 changes: 8 additions & 3 deletions main/_modules/minari/storage/hosting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,10 @@ <h1>Source code for minari.storage.hosting</h1><div class="highlight"><pre>

<span class="c1"># 2. Check if there are any remote compatible versions with the local installed Minari version</span>
<span class="n">max_version</span> <span class="o">=</span> <span class="n">get_remote_dataset_versions</span><span class="p">(</span>
<span class="n">download_env_name</span><span class="p">,</span> <span class="n">download_dataset_name</span><span class="p">,</span> <span class="n">latest_version</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">compatible_minari_version</span><span class="o">=</span><span class="kc">True</span>
<span class="n">download_env_name</span><span class="p">,</span>
<span class="n">download_dataset_name</span><span class="p">,</span>
<span class="n">latest_version</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">compatible_minari_version</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">max_version</span><span class="p">:</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">force_download</span><span class="p">:</span>
Expand Down Expand Up @@ -501,8 +504,10 @@ <h1>Source code for minari.storage.hosting</h1><div class="highlight"><pre>
<span class="n">compatible_minari_version</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">if</span> <span class="n">download_version</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">compatible_dataset_versions</span><span class="p">:</span>
<span class="n">e_msg</span> <span class="o">=</span> <span class="p">(</span><span class="sa">f</span><span class="s2">&quot;The version you are trying to download for dataset, </span><span class="si">{</span><span class="n">dataset_id</span><span class="si">}</span><span class="s2">, is not compatible with &quot;</span>
<span class="sa">f</span><span class="s2">&quot;your local installed version of Minari, </span><span class="si">{</span><span class="n">__version__</span><span class="si">}</span><span class="s2">.&quot;</span><span class="p">)</span>
<span class="n">e_msg</span> <span class="o">=</span> <span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;The version you are trying to download for dataset, </span><span class="si">{</span><span class="n">dataset_id</span><span class="si">}</span><span class="s2">, is not compatible with &quot;</span>
<span class="sa">f</span><span class="s2">&quot;your local installed version of Minari, </span><span class="si">{</span><span class="n">__version__</span><span class="si">}</span><span class="s2">.&quot;</span>
<span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">force_download</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="n">e_msg</span>
Expand Down
Loading

0 comments on commit a630aa3

Please sign in to comment.