-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 205e286 🚀
- Loading branch information
Showing
43 changed files
with
4,517 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: f960dfbdd2f8519167e6ad7ca6d91f08 | ||
config: ddd11be611183f39ea557ead8d38c6d8 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<!DOCTYPE html> | ||
|
||
<html lang="en" data-content_root="../../"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>biocutils.combine — biocutils 0.1.0 documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" /> | ||
<link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=233b9934" /> | ||
<script src="../../_static/documentation_options.js?v=01f34227"></script> | ||
<script src="../../_static/doctools.js?v=888ff710"></script> | ||
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script> | ||
<link rel="index" title="Index" href="../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../search.html" /> | ||
|
||
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" /> | ||
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" /> | ||
|
||
</head><body> | ||
|
||
|
||
<div class="document"> | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
|
||
|
||
<div class="body" role="main"> | ||
|
||
<h1>Source code for biocutils.combine</h1><div class="highlight"><pre> | ||
<span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span> | ||
|
||
<span class="kn">from</span> <span class="nn">.combine_rows</span> <span class="kn">import</span> <span class="n">combine_rows</span> | ||
<span class="kn">from</span> <span class="nn">.combine_sequences</span> <span class="kn">import</span> <span class="n">combine_sequences</span> | ||
<span class="kn">from</span> <span class="nn">.is_high_dimensional</span> <span class="kn">import</span> <span class="n">is_high_dimensional</span> | ||
|
||
|
||
<div class="viewcode-block" id="combine"> | ||
<a class="viewcode-back" href="../../api/biocutils.html#biocutils.combine.combine">[docs]</a> | ||
<span class="k">def</span> <span class="nf">combine</span><span class="p">(</span><span class="o">*</span><span class="n">x</span><span class="p">:</span> <span class="n">Any</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">"""</span> | ||
<span class="sd"> Generic combine that checks if the objects are n-dimensional for n > 1</span> | ||
<span class="sd"> (i.e. has a ``shape`` property of length greater than 1); if so, it calls</span> | ||
<span class="sd"> :py:func:`~biocutils.combine_rows.combine_rows` to combine them by the</span> | ||
<span class="sd"> first dimension, otherwise it assumes that they are vector-like and calls</span> | ||
<span class="sd"> :py:func:`~biocutils.combine_sequences.combine_sequences` instead.</span> | ||
|
||
<span class="sd"> Args:</span> | ||
<span class="sd"> x: Objects to combine.</span> | ||
|
||
<span class="sd"> Returns:</span> | ||
<span class="sd"> A combined object, typically the same type as the first element in ``x``.</span> | ||
<span class="sd"> """</span> | ||
<span class="n">has_1d</span> <span class="o">=</span> <span class="kc">False</span> | ||
<span class="n">has_nd</span> <span class="o">=</span> <span class="kc">False</span> | ||
<span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="n">x</span><span class="p">:</span> | ||
<span class="k">if</span> <span class="n">is_high_dimensional</span><span class="p">(</span><span class="n">y</span><span class="p">):</span> | ||
<span class="n">has_nd</span> <span class="o">=</span> <span class="kc">True</span> | ||
<span class="k">else</span><span class="p">:</span> | ||
<span class="n">has_1d</span> <span class="o">=</span> <span class="kc">True</span> | ||
|
||
<span class="k">if</span> <span class="n">has_nd</span> <span class="ow">and</span> <span class="n">has_1d</span><span class="p">:</span> | ||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"cannot mix 1-dimensional and higher-dimensional objects in `combine`"</span><span class="p">)</span> | ||
<span class="k">if</span> <span class="n">has_nd</span><span class="p">:</span> | ||
<span class="k">return</span> <span class="n">combine_rows</span><span class="p">(</span><span class="o">*</span><span class="n">x</span><span class="p">)</span> | ||
<span class="k">else</span><span class="p">:</span> | ||
<span class="k">return</span> <span class="n">combine_sequences</span><span class="p">(</span><span class="o">*</span><span class="n">x</span><span class="p">)</span></div> | ||
|
||
</pre></div> | ||
|
||
</div> | ||
|
||
</div> | ||
</div> | ||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
<div class="sphinxsidebarwrapper"> | ||
<h1 class="logo"><a href="../../index.html">biocutils</a></h1> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../../readme.html">Overview</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../contributing.html">Contributions & Help</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../license.html">License</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Authors</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../changelog.html">Changelog</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../api/modules.html">Module Reference</a></li> | ||
</ul> | ||
|
||
<div class="relations"> | ||
<h3>Related Topics</h3> | ||
<ul> | ||
<li><a href="../../index.html">Documentation overview</a><ul> | ||
<li><a href="../index.html">Module code</a><ul> | ||
</ul></li> | ||
</ul></li> | ||
</ul> | ||
</div> | ||
<div id="searchbox" style="display: none" role="search"> | ||
<h3 id="searchlabel">Quick search</h3> | ||
<div class="searchformwrapper"> | ||
<form class="search" action="../../search.html" method="get"> | ||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> | ||
<input type="submit" value="Go" /> | ||
</form> | ||
</div> | ||
</div> | ||
<script>document.getElementById('searchbox').style.display = "block"</script> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div> | ||
</div> | ||
<div class="clearer"></div> | ||
</div> | ||
<div class="footer"> | ||
©2023, Aaron Lun. | ||
|
||
| | ||
Powered by <a href="http://sphinx-doc.org/">Sphinx 7.2.6</a> | ||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a> | ||
|
||
</div> | ||
|
||
|
||
|
||
|
||
</body> | ||
</html> |
Oops, something went wrong.