Skip to content

Commit

Permalink
Deploying to pages from @ 8e343d0 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
d33bs committed Jul 3, 2024
1 parent 4aabe9e commit 735993d
Show file tree
Hide file tree
Showing 10 changed files with 616 additions and 65 deletions.
29 changes: 11 additions & 18 deletions _modules/cytotable/convert.html

Large diffs are not rendered by default.

455 changes: 455 additions & 0 deletions _modules/cytotable/sources.html

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions _modules/cytotable/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ <h1>Source code for cytotable.utils</h1><div class="highlight"><pre>
<span class="s2"> INSTALL sqlite_scanner;</span>
<span class="s2"> LOAD sqlite_scanner;</span>

<span class="s2"> /* Install httpfs plugin to avoid error</span>
<span class="s2"> https://github.com/duckdb/duckdb/issues/3243 */</span>
<span class="s2"> INSTALL httpfs;</span>

<span class="s2"> /*</span>
<span class="s2"> Set threads available to duckdb</span>
<span class="s2"> See the following for more information:</span>
Expand Down Expand Up @@ -357,7 +361,7 @@ <h1>Source code for cytotable.utils</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">pa</span><span class="o">.</span><span class="n">Table</span><span class="o">.</span><span class="n">from_pylist</span><span class="p">(</span><span class="n">results</span><span class="p">)</span></div>


<div class="viewcode-block" id="_cache_cloudpath_to_local"><a class="viewcode-back" href="../../python-api.html#cytotable.utils._cache_cloudpath_to_local">[docs]</a><span class="k">def</span> <span class="nf">_cache_cloudpath_to_local</span><span class="p">(</span><span class="n">path</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">AnyPath</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">:</span>
<div class="viewcode-block" id="_cache_cloudpath_to_local"><a class="viewcode-back" href="../../python-api.html#cytotable.utils._cache_cloudpath_to_local">[docs]</a><span class="k">def</span> <span class="nf">_cache_cloudpath_to_local</span><span class="p">(</span><span class="n">path</span><span class="p">:</span> <span class="n">AnyPath</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Takes a cloudpath and uses cache to convert to a local copy</span>
<span class="sd"> for use in scenarios where remote work is not possible (sqlite).</span>
Expand All @@ -372,24 +376,25 @@ <h1>Source code for cytotable.utils</h1><div class="highlight"><pre>
<span class="sd"> A local pathlib.Path to cached version of cloudpath file.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">candidate_path</span> <span class="o">=</span> <span class="n">AnyPath</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>

<span class="c1"># check that the path is a file (caching won&#39;t work with a dir)</span>
<span class="c1"># and check that the file is of sqlite type</span>
<span class="c1"># (other file types will be handled remotely in cloud)</span>
<span class="k">if</span> <span class="n">candidate_path</span><span class="o">.</span><span class="n">is_file</span><span class="p">()</span> <span class="ow">and</span> <span class="n">candidate_path</span><span class="o">.</span><span class="n">suffix</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;.sqlite&quot;</span><span class="p">:</span>
<span class="k">if</span> <span class="p">(</span>
<span class="nb">isinstance</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">CloudPath</span><span class="p">)</span>
<span class="ow">and</span> <span class="n">path</span><span class="o">.</span><span class="n">is_file</span><span class="p">()</span>
<span class="ow">and</span> <span class="n">path</span><span class="o">.</span><span class="n">suffix</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;.sqlite&quot;</span>
<span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="c1"># update the path to be the local filepath for reference in CytoTable ops</span>
<span class="c1"># note: incurs a data read which will trigger caching of the file</span>
<span class="n">path</span> <span class="o">=</span> <span class="n">CloudPath</span><span class="p">(</span><span class="n">path</span><span class="p">)</span><span class="o">.</span><span class="n">fspath</span>
<span class="n">path</span> <span class="o">=</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span><span class="n">path</span><span class="o">.</span><span class="n">fspath</span><span class="p">)</span>
<span class="k">except</span> <span class="n">InvalidPrefixError</span><span class="p">:</span>
<span class="c1"># share information about not finding a cloud path</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span>
<span class="s2">&quot;Did not detect a cloud path based on prefix. Defaulting to use local path operations.&quot;</span>
<span class="p">)</span>

<span class="c1"># cast the result as a pathlib.Path</span>
<span class="k">return</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span><span class="n">path</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">path</span></div>


<div class="viewcode-block" id="_arrow_type_cast_if_specified"><a class="viewcode-back" href="../../python-api.html#cytotable.utils._arrow_type_cast_if_specified">[docs]</a><span class="k">def</span> <span class="nf">_arrow_type_cast_if_specified</span><span class="p">(</span>
Expand Down
1 change: 1 addition & 0 deletions _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<h1>All modules for which code is available</h1>
<ul><li><a href="cytotable/convert.html">cytotable.convert</a></li>
<li><a href="cytotable/exceptions.html">cytotable.exceptions</a></li>
<li><a href="cytotable/sources.html">cytotable.sources</a></li>
<li><a href="cytotable/utils.html">cytotable.utils</a></li>
</ul>

Expand Down
16 changes: 0 additions & 16 deletions _sources/python-api.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,6 @@ Sources

|

.. autofunction:: _build_path

|

.. autofunction:: _filter_source_filepaths

|

.. autofunction:: _get_source_filepaths

|

.. autofunction:: _infer_source_datatype

|

Utils
-----

Expand Down
8 changes: 6 additions & 2 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,21 @@ <h2 id="_">_</h2>
<li><a href="python-api.html#cytotable.utils._duckdb_reader">_duckdb_reader() (in module cytotable.utils)</a>
</li>
<li><a href="python-api.html#cytotable.utils._expand_path">_expand_path() (in module cytotable.utils)</a>
</li>
<li><a href="python-api.html#cytotable.sources._file_is_more_than_one_line">_file_is_more_than_one_line() (in module cytotable.sources)</a>
</li>
<li><a href="python-api.html#cytotable.sources._filter_source_filepaths">_filter_source_filepaths() (in module cytotable.sources)</a>
</li>
<li><a href="python-api.html#cytotable.sources._gather_sources">_gather_sources() (in module cytotable.sources)</a>
</li>
<li><a href="python-api.html#cytotable.utils._get_cytotable_version">_get_cytotable_version() (in module cytotable.utils)</a>
</li>
<li><a href="python-api.html#cytotable.sources._get_source_filepaths">_get_source_filepaths() (in module cytotable.sources)</a>
</li>
<li><a href="python-api.html#cytotable.convert._get_table_chunk_offsets">_get_table_chunk_offsets() (in module cytotable.convert)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="python-api.html#cytotable.convert._get_table_chunk_offsets">_get_table_chunk_offsets() (in module cytotable.convert)</a>
</li>
<li><a href="python-api.html#cytotable.convert._get_table_columns_and_types">_get_table_columns_and_types() (in module cytotable.convert)</a>
</li>
<li><a href="python-api.html#cytotable.sources._infer_source_datatype">_infer_source_datatype() (in module cytotable.sources)</a>
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ <h2>References<a class="headerlink" href="#references" title="Permalink to this
</li>
<li class="toctree-l2"><a class="reference internal" href="python-api.html#module-cytotable.sources">Sources</a><ul>
<li class="toctree-l3"><a class="reference internal" href="python-api.html#cytotable.sources._build_path"><code class="docutils literal notranslate"><span class="pre">_build_path()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="python-api.html#cytotable.sources._file_is_more_than_one_line"><code class="docutils literal notranslate"><span class="pre">_file_is_more_than_one_line()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="python-api.html#cytotable.sources._filter_source_filepaths"><code class="docutils literal notranslate"><span class="pre">_filter_source_filepaths()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="python-api.html#cytotable.sources._gather_sources"><code class="docutils literal notranslate"><span class="pre">_gather_sources()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="python-api.html#cytotable.sources._get_source_filepaths"><code class="docutils literal notranslate"><span class="pre">_get_source_filepaths()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="python-api.html#cytotable.sources._infer_source_datatype"><code class="docutils literal notranslate"><span class="pre">_infer_source_datatype()</span></code></a></li>
</ul>
Expand Down
Binary file modified objects.inv
Binary file not shown.
Loading

0 comments on commit 735993d

Please sign in to comment.