Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
* removed all u"..." strings and other Python2 related code
* run flake8 checks; considerable reformatting
* version bump: v0.6.0.dev2
  • Loading branch information
paulkorir committed Sep 2, 2022
1 parent 3a44c9d commit 333cb14
Show file tree
Hide file tree
Showing 74 changed files with 1,593 additions and 1,046 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#Changes by release

## [0.6.0.dev2] - 2022-09-02

Cleanup

* removed all u"..." strings and other Python2 related code
* run flake8 checks; considerable reformatting

## [0.6.0.dev1] - 2022-09-02

Bugfixes
Expand Down
Binary file modified docs/_build/doctrees/annotating.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/converting.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/core.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/developing.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/extending.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/formats.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/misc.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/notes.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/readers.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/sfftk.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/toolkit.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.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: 6d0e33278e667fe5319d99f7034e3c27
config: 026acb1afade4227ecfc3433d677bb5f
tags: 645f666f9bcd5a90fca523b33c5a78b7
4 changes: 2 additions & 2 deletions docs/_build/html/_sources/annotating.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ Use quotes (single/double) to enter software processing details:
.. code::
# not in MODIFY state
#not in MODIFY state
sff notes add -P "Density map was automatically segmented using the watershed algorithm on a HP Cluster with 200 nodes" file.json
# MODIFY state
sff notes add --software-processing-details "Threshold of 1.08" @
Expand Down Expand Up @@ -1212,7 +1212,7 @@ More examples:
# not in MODIFY state
sff notes add -E ncbitaxon http://purl.obolibrary.org/obo/NCBITaxon_559292 NCBITaxon_559292 file.json
# MODIFY state
# more than one reference
#more than one reference
sff notes add -E ncbitaxon http://purl.obolibrary.org/obo/NCBITaxon_559292 NCBITaxon_559292 -E pdb http://www.ebi.ac.uk/pdbe/entry/pdb/3ja8 3ja8 @
Adding Segment Notes
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/_sources/developing.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ First make an note containing the edits. For ``external_references`` specify the
... name='some name',
... description='new description',
... number_of_instances=14,
... external_reference_id=0, # the external reference ID to change
... external_reference_id=0, #the external reference ID to change
... external_references=[
... ExternalReference(resource='x', url='y', accession='z')
... ],
Expand Down Expand Up @@ -149,7 +149,7 @@ CCP4 (.map)
.. code:: python
>>> from sfftk.formats.map import MAPSegmentation
>>> map_seg = MapSegmentation('file.map')
>>> map_seg = MAPSegmentation('file.map')
IMOD (.mod)
-----------
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: 'v0.5.5.dev1',
LANGUAGE: 'en',
VERSION: 'v0.6.0.dev1',
LANGUAGE: 'en-gb',
COLLAPSE_INDEX: false,
BUILDER: 'html',
FILE_SUFFIX: '.html',
Expand Down
10 changes: 5 additions & 5 deletions docs/_build/html/annotating.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en-gb" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Annotating EMDB-SFF Segmentations &mdash; sfftk v0.5.5.dev1 documentation</title>
<title>Annotating EMDB-SFF Segmentations &mdash; sfftk v0.6.0.dev1 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand All @@ -31,7 +31,7 @@
<a href="index.html" class="icon icon-home"> sfftk
</a>
<div class="version">
v0.5
v0.6
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down Expand Up @@ -1318,7 +1318,7 @@ <h5><a class="toc-backref" href="#id40">Adding The Software</a><a class="headerl
</pre></div>
</div>
<p>Use quotes (single/double) to enter software processing details:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># not in MODIFY state</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">#not in MODIFY state</span>
<span class="n">sff</span> <span class="n">notes</span> <span class="n">add</span> <span class="o">-</span><span class="n">P</span> <span class="s2">&quot;Density map was automatically segmented using the watershed algorithm on a HP Cluster with 200 nodes&quot;</span> <span class="n">file</span><span class="o">.</span><span class="n">json</span>
<span class="c1"># MODIFY state</span>
<span class="n">sff</span> <span class="n">notes</span> <span class="n">add</span> <span class="o">--</span><span class="n">software</span><span class="o">-</span><span class="n">processing</span><span class="o">-</span><span class="n">details</span> <span class="s2">&quot;Threshold of 1.08&quot;</span> <span class="o">@</span>
Expand Down Expand Up @@ -1363,7 +1363,7 @@ <h5><a class="toc-backref" href="#id42">Adding An External Reference (Global Or
<span class="c1"># not in MODIFY state</span>
sff notes add -E ncbitaxon http://purl.obolibrary.org/obo/NCBITaxon_559292 NCBITaxon_559292 file.json
<span class="c1"># MODIFY state</span>
<span class="c1"># more than one reference</span>
<span class="c1">#more than one reference</span>
sff notes add -E ncbitaxon http://purl.obolibrary.org/obo/NCBITaxon_559292 NCBITaxon_559292 -E pdb http://www.ebi.ac.uk/pdbe/entry/pdb/3ja8 3ja8 @
</pre></div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/converting.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en-gb" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Converting Files To EMDB-SFF &mdash; sfftk v0.5.5.dev1 documentation</title>
<title>Converting Files To EMDB-SFF &mdash; sfftk v0.6.0.dev1 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand All @@ -31,7 +31,7 @@
<a href="index.html" class="icon icon-home"> sfftk
</a>
<div class="version">
v0.5
v0.6
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
66 changes: 60 additions & 6 deletions docs/_build/html/core.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en-gb" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>sfftk.core package &mdash; sfftk v0.5.5.dev1 documentation</title>
<title>sfftk.core package &mdash; sfftk v0.6.0.dev1 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand All @@ -30,7 +30,7 @@
<a href="index.html" class="icon icon-home"> sfftk
</a>
<div class="version">
v0.5
v0.6
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand All @@ -57,7 +57,10 @@
<li class="toctree-l4"><a class="reference internal" href="#sfftk-core-configs"><code class="docutils literal notranslate"><span class="pre">sfftk.core.configs</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#parser">Parser</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module-sfftk.core.parser">Parser</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#sfftk-core-parser"><code class="docutils literal notranslate"><span class="pre">sfftk.core.parser</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#module-sfftk.core.prep">Preparation utilities</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#sfftk-core-prep"><code class="docutils literal notranslate"><span class="pre">sfftk.core.prep</span></code></a></li>
</ul>
Expand Down Expand Up @@ -294,8 +297,59 @@ <h3><code class="docutils literal notranslate"><span class="pre">sfftk.core.conf

</section>
</section>
<section id="parser">
<h2>Parser<a class="headerlink" href="#parser" title="Permalink to this heading"></a></h2>
<section id="module-sfftk.core.parser">
<span id="parser"></span><h2>Parser<a class="headerlink" href="#module-sfftk.core.parser" title="Permalink to this heading"></a></h2>
<section id="sfftk-core-parser">
<h3><code class="docutils literal notranslate"><span class="pre">sfftk.core.parser</span></code><a class="headerlink" href="#sfftk-core-parser" title="Permalink to this heading"></a></h3>
<p>A large number of functions in <code class="docutils literal notranslate"><span class="pre">sfftk</span></code> consume only two arguments: <code class="docutils literal notranslate"><span class="pre">args</span></code>, which is the direct output of
Python’s <a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">argparse.ArgumentParser</span></code></a> and a <code class="docutils literal notranslate"><span class="pre">configs</span></code> dictionary, which consists of all persistent configs.
This module extends the parser object <code class="xref py py-class docutils literal notranslate"><span class="pre">sfftkrw.core.parser.Parser</span></code> as well as includes a
<a class="reference internal" href="#sfftk.core.parser.parse_args" title="sfftk.core.parser.parse_args"><code class="xref py py-func docutils literal notranslate"><span class="pre">sfftk.core.parser.parse_args()</span></code></a> function which does sanity checking of all command line arguments.</p>
<dl class="py function">
<dt class="sig sig-object py" id="sfftk.core.parser.check_multi_file_formats">
<span class="sig-prename descclassname"><span class="pre">sfftk.core.parser.</span></span><span class="sig-name descname"><span class="pre">check_multi_file_formats</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">file_names</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/sfftk/core/parser.html#check_multi_file_formats"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sfftk.core.parser.check_multi_file_formats" title="Permalink to this definition"></a></dt>
<dd><p>Check file names for file formats</p>
<p>When working with multifile segmentations, this function checks that all files are consistent</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>file_names</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a>) – a list of file names</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a tuple consisting of whether or not the set of file formats if valid, the set of file formats observed
and the set of invalid file formats</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.10)">tuple</a>[<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#set" title="(in Python v3.10)">set</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#set" title="(in Python v3.10)">set</a>]</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sfftk.core.parser.parse_args">
<span class="sig-prename descclassname"><span class="pre">sfftk.core.parser.</span></span><span class="sig-name descname"><span class="pre">parse_args</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">_args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_shlex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/sfftk/core/parser.html#parse_args"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sfftk.core.parser.parse_args" title="Permalink to this definition"></a></dt>
<dd><p>Parse and check command-line arguments and also return configs.</p>
<p>This function does all the heavy lifting in ensuring that commandline
arguments are properly formatted and checked for sanity. It also
extracts configs from the config files.</p>
<p>In this way command handlers (defined in <a class="reference internal" href="sff.html#module-sfftk.sff" title="sfftk.sff"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sfftk.sff</span></code></a> e.g. <a class="reference internal" href="sff.html#sfftk.sff.handle_convert" title="sfftk.sff.handle_convert"><code class="xref py py-meth docutils literal notranslate"><span class="pre">sfftk.sff.handle_convert()</span></code></a>) assume
correct argument values and can concentrate on functionality making the code more readable.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>_args</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – list of arguments (<code class="docutils literal notranslate"><span class="pre">use_shlex=False</span></code>); string of arguments (<code class="docutils literal notranslate"><span class="pre">use_shlex=True</span></code>)</p></li>
<li><p><strong>use_shlex</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – treat <code class="docutils literal notranslate"><span class="pre">_args</span></code> as a string instead for parsing using <code class="docutils literal notranslate"><span class="pre">shlex</span></code> lib</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>parsed arguments</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple[<a class="reference external" href="https://docs.python.org/3/library/argparse.html#argparse.Namespace" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">argparse.Namespace</span></code></a>, <a class="reference internal" href="#sfftk.core.configs.Configs" title="sfftk.core.configs.Configs"><code class="xref py py-class docutils literal notranslate"><span class="pre">sfftk.core.configs.Configs</span></code></a>]</p>
</dd>
</dl>
</dd></dl>

</section>
</section>
<section id="module-sfftk.core.prep">
<span id="preparation-utilities"></span><h2>Preparation utilities<a class="headerlink" href="#module-sfftk.core.prep" title="Permalink to this heading"></a></h2>
Expand Down
8 changes: 4 additions & 4 deletions docs/_build/html/developing.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en-gb" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Developing with sfftk &mdash; sfftk v0.5.5.dev1 documentation</title>
<title>Developing with sfftk &mdash; sfftk v0.6.0.dev1 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand All @@ -31,7 +31,7 @@
<a href="index.html" class="icon icon-home"> sfftk
</a>
<div class="version">
v0.5
v0.6
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down Expand Up @@ -202,7 +202,7 @@ <h3><a class="toc-backref" href="#id6">Adding Notes</a><a class="headerlink" hre
<span class="gp">... </span> <span class="n">name</span><span class="o">=</span><span class="s1">&#39;some name&#39;</span><span class="p">,</span>
<span class="go"> ... description=&#39;new description&#39;,</span>
<span class="go"> ... number_of_instances=14,</span>
<span class="go"> ... external_reference_id=0, # the external reference ID to change</span>
<span class="go"> ... external_reference_id=0, #the external reference ID to change</span>
<span class="go"> ... external_references=[</span>
<span class="go"> ... ExternalReference(resource=&#39;x&#39;, url=&#39;y&#39;, accession=&#39;z&#39;)</span>
<span class="go"> ... ],</span>
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/extending.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en-gb" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Extending sfftk &mdash; sfftk v0.5.5.dev1 documentation</title>
<title>Extending sfftk &mdash; sfftk v0.6.0.dev1 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand All @@ -31,7 +31,7 @@
<a href="index.html" class="icon icon-home"> sfftk
</a>
<div class="version">
v0.5
v0.6
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/formats.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<html class="writer-html5" lang="en-gb" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>sfftk.formats package &mdash; sfftk v0.5.5.dev1 documentation</title>
<title>sfftk.formats package &mdash; sfftk v0.6.0.dev1 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
Expand All @@ -31,7 +31,7 @@
<a href="index.html" class="icon icon-home"> sfftk
</a>
<div class="version">
v0.5
v0.6
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
Loading

0 comments on commit 333cb14

Please sign in to comment.