Skip to content

Commit

Permalink
Fixed bug reading complicated Newick labels
Browse files Browse the repository at this point in the history
  • Loading branch information
niemasd committed Jul 28, 2019
1 parent 4c5d7f7 commit 00004b1
Show file tree
Hide file tree
Showing 26 changed files with 922 additions and 1,611 deletions.
2 changes: 1 addition & 1 deletion docs/.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: aa3f3270dabdc76838123769ce828643
config: 39554576fa41e4dbf8cbe9ad62a111f9
tags: 645f666f9bcd5a90fca523b33c5a78b7
18 changes: 8 additions & 10 deletions docs/_modules/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<title>Overview: module code &#8212; TreeSwift documentation</title>
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="../_static/language_data.js"></script>

<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
</head><body>
Expand Down Expand Up @@ -46,13 +46,11 @@ <h1>All modules for which code is available</h1>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
Expand All @@ -75,7 +73,7 @@ <h3>Navigation</h3>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2018, Niema Moshiri.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.6.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.1.2.
</div>
</body>
</html>
18 changes: 8 additions & 10 deletions docs/_modules/treeswift/Node.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<title>treeswift.Node &#8212; TreeSwift documentation</title>
<link rel="stylesheet" href="../../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="../../_static/language_data.js"></script>

<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
</head><body>
Expand Down Expand Up @@ -419,13 +419,11 @@ <h1>Source code for treeswift.Node</h1><div class="highlight"><pre>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../search.html" method="get">
<input type="text" name="q" />
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
Expand All @@ -449,7 +447,7 @@ <h3>Navigation</h3>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2018, Niema Moshiri.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.6.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.1.2.
</div>
</body>
</html>
32 changes: 20 additions & 12 deletions docs/_modules/treeswift/Tree.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<title>treeswift.Tree &#8212; TreeSwift documentation</title>
<link rel="stylesheet" href="../../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="../../_static/language_data.js"></script>

<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
</head><body>
Expand Down Expand Up @@ -50,6 +50,12 @@ <h1>Source code for treeswift.Tree</h1><div class="highlight"><pre>
<span class="n">INVALID_NEXML</span> <span class="o">=</span> <span class="s2">&quot;Invalid valid NeXML File&quot;</span>
<span class="n">EULER_GAMMA</span> <span class="o">=</span> <span class="mf">0.5772156649015328606065120900824024310421</span>

<span class="c1"># store bracket open/close for convenience in label parsing</span>
<span class="n">BRACKET</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">&#39;[&#39;</span><span class="p">:</span> <span class="s1">&#39;]&#39;</span><span class="p">,</span>
<span class="s1">&#39;{&#39;</span><span class="p">:</span> <span class="s1">&#39;}&#39;</span><span class="p">,</span>
<span class="p">}</span>

<div class="viewcode-block" id="Tree"><a class="viewcode-back" href="../../index.html#treeswift.Tree">[docs]</a><span class="k">class</span> <span class="nc">Tree</span><span class="p">:</span>
<span class="sd">&#39;&#39;&#39;``Tree`` class&#39;&#39;&#39;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">is_rooted</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
Expand Down Expand Up @@ -1305,8 +1311,12 @@ <h1>Source code for treeswift.Tree</h1><div class="highlight"><pre>
<span class="n">ls</span> <span class="o">+=</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">];</span> <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="n">n</span><span class="o">.</span><span class="n">edge_length</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">ls</span><span class="p">);</span> <span class="n">i</span> <span class="o">-=</span> <span class="mi">1</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">label</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
<span class="k">while</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;:&#39;</span> <span class="ow">and</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;,&#39;</span> <span class="ow">and</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;;&#39;</span> <span class="ow">and</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;)&#39;</span><span class="p">:</span>
<span class="n">label</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span> <span class="n">bracket</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">while</span> <span class="n">bracket</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="ow">in</span> <span class="n">BRACKET</span> <span class="ow">or</span> <span class="p">(</span><span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;:&#39;</span> <span class="ow">and</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;,&#39;</span> <span class="ow">and</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;;&#39;</span> <span class="ow">and</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;)&#39;</span><span class="p">):</span>
<span class="k">if</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="ow">in</span> <span class="n">BRACKET</span> <span class="ow">and</span> <span class="n">bracket</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">bracket</span> <span class="o">=</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
<span class="k">elif</span> <span class="n">bracket</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="n">BRACKET</span><span class="p">[</span><span class="n">bracket</span><span class="p">]:</span>
<span class="n">bracket</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">label</span> <span class="o">+=</span> <span class="n">ts</span><span class="p">[</span><span class="n">i</span><span class="p">];</span> <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="n">i</span> <span class="o">-=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">n</span><span class="o">.</span><span class="n">label</span> <span class="o">=</span> <span class="n">label</span>
<span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
Expand Down Expand Up @@ -1492,13 +1502,11 @@ <h1>Source code for treeswift.Tree</h1><div class="highlight"><pre>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../search.html" method="get">
<input type="text" name="q" />
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
Expand All @@ -1522,7 +1530,7 @@ <h3>Navigation</h3>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2018, Niema Moshiri.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.6.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.1.2.
</div>
</body>
</html>
Binary file removed docs/_static/ajax-loader.gif
Binary file not shown.
102 changes: 100 additions & 2 deletions docs/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down Expand Up @@ -81,6 +81,10 @@ div.sphinxsidebar input {
font-size: 1em;
}

div.sphinxsidebar #searchbox form.search {
overflow: hidden;
}

div.sphinxsidebar #searchbox input[type="text"] {
float: left;
width: 80%;
Expand Down Expand Up @@ -227,6 +231,16 @@ a.headerlink {
visibility: hidden;
}

a.brackets:before,
span.brackets > a:before{
content: "[";
}

a.brackets:after,
span.brackets > a:after {
content: "]";
}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
Expand Down Expand Up @@ -275,6 +289,12 @@ img.align-center, .figure.align-center, object.align-center {
margin-right: auto;
}

img.align-default, .figure.align-default {
display: block;
margin-left: auto;
margin-right: auto;
}

.align-left {
text-align: left;
}
Expand All @@ -283,6 +303,10 @@ img.align-center, .figure.align-center, object.align-center {
text-align: center;
}

.align-default {
text-align: center;
}

.align-right {
text-align: right;
}
Expand Down Expand Up @@ -354,6 +378,11 @@ table.align-center {
margin-right: auto;
}

table.align-default {
margin-left: auto;
margin-right: auto;
}

table caption span.caption-number {
font-style: italic;
}
Expand Down Expand Up @@ -387,6 +416,16 @@ table.citation td {
border-bottom: none;
}

th > p:first-child,
td > p:first-child {
margin-top: 0px;
}

th > p:last-child,
td > p:last-child {
margin-bottom: 0px;
}

/* -- figures --------------------------------------------------------------- */

div.figure {
Expand Down Expand Up @@ -427,6 +466,13 @@ table.field-list td, table.field-list th {
hyphens: manual;
}

/* -- hlist styles ---------------------------------------------------------- */

table.hlist td {
vertical-align: top;
}


/* -- other body styles ----------------------------------------------------- */

ol.arabic {
Expand All @@ -449,11 +495,57 @@ ol.upperroman {
list-style: upper-roman;
}

li > p:first-child {
margin-top: 0px;
}

li > p:last-child {
margin-bottom: 0px;
}

dl.footnote > dt,
dl.citation > dt {
float: left;
}

dl.footnote > dd,
dl.citation > dd {
margin-bottom: 0em;
}

dl.footnote > dd:after,
dl.citation > dd:after {
content: "";
clear: both;
}

dl.field-list {
display: flex;
flex-wrap: wrap;
}

dl.field-list > dt {
flex-basis: 20%;
font-weight: bold;
word-break: break-word;
}

dl.field-list > dt:after {
content: ":";
}

dl.field-list > dd {
flex-basis: 70%;
padding-left: 1em;
margin-left: 0em;
margin-bottom: 0em;
}

dl {
margin-bottom: 15px;
}

dd p {
dd > p:first-child {
margin-top: 0px;
}

Expand Down Expand Up @@ -526,6 +618,12 @@ dl.glossary dt {
font-style: oblique;
}

.classifier:before {
font-style: normal;
margin: 0.5em;
content: ":";
}

abbr, acronym {
border-bottom: dotted 1px;
cursor: help;
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/classic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- classic theme.
*
* :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
Binary file removed docs/_static/comment-bright.png
Binary file not shown.
Binary file removed docs/_static/comment-close.png
Binary file not shown.
Binary file removed docs/_static/comment.png
Binary file not shown.
Loading

0 comments on commit 00004b1

Please sign in to comment.