Skip to content

Commit

Permalink
Deploy dev from 0962591
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 24, 2023
1 parent da9cae2 commit 08773c0
Show file tree
Hide file tree
Showing 63 changed files with 378 additions and 178 deletions.
2 changes: 1 addition & 1 deletion dev/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ <h1>All modules for which code is available</h1>
<p>

&copy; Copyright 2023, The Pooch Developers.<br/>
Last updated on Feb 27, 2023.<br/>
Last updated on Oct 24, 2023.<br/>
</p>
</footer>
</main>
Expand Down
2 changes: 1 addition & 1 deletion dev/_modules/pooch.html
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ <h1>Source code for pooch</h1><div class="highlight"><pre>
<p>

&copy; Copyright 2023, The Pooch Developers.<br/>
Last updated on Feb 27, 2023.<br/>
Last updated on Oct 24, 2023.<br/>
</p>
</footer>
</main>
Expand Down
24 changes: 14 additions & 10 deletions dev/_modules/pooch/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,6 @@ <h1>Source code for pooch.core</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">shlex</span>
<span class="kn">import</span> <span class="nn">shutil</span>

<span class="kn">import</span> <span class="nn">requests</span>
<span class="kn">import</span> <span class="nn">requests.exceptions</span>

<span class="kn">from</span> <span class="nn">.hashes</span> <span class="kn">import</span> <span class="n">hash_matches</span><span class="p">,</span> <span class="n">file_hash</span>
<span class="kn">from</span> <span class="nn">.utils</span> <span class="kn">import</span> <span class="p">(</span>
Expand Down Expand Up @@ -514,7 +512,7 @@ <h1>Source code for pooch.core</h1><div class="highlight"><pre>
<span class="sd"> existing file needs to be updated.</span>
<span class="sd"> fname : str or None</span>
<span class="sd"> The name that will be used to save the file. Should NOT include the</span>
<span class="sd"> full the path, just the file name (it will be appended to *path*). If</span>
<span class="sd"> full path, just the file name (it will be appended to *path*). If</span>
<span class="sd"> None, will create a unique file name using a combination of the last</span>
<span class="sd"> part of the URL (assuming it&#39;s the file name) and the MD5 hash of the</span>
<span class="sd"> URL. For example, ``81whdo2d2e928yd1wi22-data-file.csv``. This ensures</span>
Expand Down Expand Up @@ -645,15 +643,17 @@ <h1>Source code for pooch.core</h1><div class="highlight"><pre>
<span class="n">path</span> <span class="o">=</span> <span class="n">os_cache</span><span class="p">(</span><span class="s2">&quot;pooch&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">fname</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">fname</span> <span class="o">=</span> <span class="n">unique_file_name</span><span class="p">(</span><span class="n">url</span><span class="p">)</span>
<span class="c1"># Create the local data directory if it doesn&#39;t already exist and make the</span>
<span class="c1"># path absolute.</span>
<span class="c1"># Make the path absolute.</span>
<span class="n">path</span> <span class="o">=</span> <span class="n">cache_location</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">env</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">version</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
<span class="n">make_local_storage</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>

<span class="n">full_path</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span> <span class="o">/</span> <span class="n">fname</span>
<span class="n">action</span><span class="p">,</span> <span class="n">verb</span> <span class="o">=</span> <span class="n">download_action</span><span class="p">(</span><span class="n">full_path</span><span class="p">,</span> <span class="n">known_hash</span><span class="p">)</span>

<span class="k">if</span> <span class="n">action</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;download&quot;</span><span class="p">,</span> <span class="s2">&quot;update&quot;</span><span class="p">):</span>
<span class="c1"># We need to write data, so create the local data directory if it</span>
<span class="c1"># doesn&#39;t already exist.</span>
<span class="n">make_local_storage</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>

<span class="n">get_logger</span><span class="p">()</span><span class="o">.</span><span class="n">info</span><span class="p">(</span>
<span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> data from &#39;</span><span class="si">%s</span><span class="s2">&#39; to file &#39;</span><span class="si">%s</span><span class="s2">&#39;.&quot;</span><span class="p">,</span>
<span class="n">verb</span><span class="p">,</span>
Expand Down Expand Up @@ -988,9 +988,6 @@ <h1>Source code for pooch.core</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_assert_file_in_registry</span><span class="p">(</span><span class="n">fname</span><span class="p">)</span>

<span class="c1"># Create the local data directory if it doesn&#39;t already exist</span>
<span class="n">make_local_storage</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abspath</span><span class="p">))</span>

<span class="n">url</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_url</span><span class="p">(</span><span class="n">fname</span><span class="p">)</span>
<span class="n">full_path</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">abspath</span> <span class="o">/</span> <span class="n">fname</span>
<span class="n">known_hash</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">registry</span><span class="p">[</span><span class="n">fname</span><span class="p">]</span>
Expand All @@ -1002,6 +999,10 @@ <h1>Source code for pooch.core</h1><div class="highlight"><pre>
<span class="p">)</span>

<span class="k">if</span> <span class="n">action</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;download&quot;</span><span class="p">,</span> <span class="s2">&quot;update&quot;</span><span class="p">):</span>
<span class="c1"># We need to write data, so create the local data directory if it</span>
<span class="c1"># doesn&#39;t already exist.</span>
<span class="n">make_local_storage</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">abspath</span><span class="p">))</span>

<span class="n">get_logger</span><span class="p">()</span><span class="o">.</span><span class="n">info</span><span class="p">(</span>
<span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> file &#39;</span><span class="si">%s</span><span class="s2">&#39; from &#39;</span><span class="si">%s</span><span class="s2">&#39; to &#39;</span><span class="si">%s</span><span class="s2">&#39;.&quot;</span><span class="p">,</span>
<span class="n">verb</span><span class="p">,</span>
Expand Down Expand Up @@ -1217,6 +1218,9 @@ <h1>Source code for pooch.core</h1><div class="highlight"><pre>
<span class="sd"> will retry the download the specified number of times in case the failure</span>
<span class="sd"> was due to a network error.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Lazy import requests to speed up import time</span>
<span class="kn">import</span> <span class="nn">requests.exceptions</span> <span class="c1"># pylint: disable=C0415</span>

<span class="c1"># Ensure the parent directory exists in case the file is in a subdirectory.</span>
<span class="c1"># Otherwise, move will cause an error.</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">fname</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">exists</span><span class="p">():</span>
Expand Down Expand Up @@ -1259,7 +1263,7 @@ <h1>Source code for pooch.core</h1><div class="highlight"><pre>
<p>

&copy; Copyright 2023, The Pooch Developers.<br/>
Last updated on Feb 27, 2023.<br/>
Last updated on Oct 24, 2023.<br/>
</p>
</footer>
</main>
Expand Down
Loading

0 comments on commit 08773c0

Please sign in to comment.