Skip to content

Commit

Permalink
rebuild doc and bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
laowantong committed Nov 29, 2020
1 parent 98c351f commit 4626798
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 32 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![paroxython SLOC](https://img.shields.io/badge/main%20program-~1850%20SLOC-blue)](https://github.com/laowantong/paroxython/blob/master/paroxython)
[![tests SLOC](https://img.shields.io/badge/tests-~2550%20SLOC-blue)](https://github.com/laowantong/paroxython/blob/master/tests)
[![helpers SLOC](https://img.shields.io/badge/helpers-~950%20SLOC-blue)](https://github.com/laowantong/paroxython/blob/master/helpers)
[![spec features](https://img.shields.io/badge/spec-171%20features-blue)](https://github.com/laowantong/paroxython/blob/master/paroxython/resources/spec.md)
[![spec features](https://img.shields.io/badge/spec-172%20features-blue)](https://github.com/laowantong/paroxython/blob/master/paroxython/resources/spec.md)
[![taxonomy mappings](https://img.shields.io/badge/taxonomy-280%20mappings-blue)](https://github.com/laowantong/paroxython/blob/master/paroxython/resources/taxonomy.tsv)
![GitHub commit activity](https://img.shields.io/github/commit-activity/y/laowantong/paroxython.svg?style=flat)
[![Downloads](https://pepy.tech/badge/paroxython/week)](https://pepy.tech/project/paroxython/week)
Expand Down Expand Up @@ -158,7 +158,7 @@ If you use Jupyter notebook/lab, you've also just installed a so-called magic co
%load_ext paroxython
```

This should print `"paroxython 0.6.2 loaded."`. Run it on a cell of Python code:
This should print `"paroxython 0.6.3 loaded."`. Run it on a cell of Python code:

```python
%%paroxython # Lines
Expand All @@ -180,7 +180,7 @@ def fibonacci(n): # 2
| `flow/loop/while` | 5-7 |
| `meta/count/program/sloc/8` | 2-8 |
| `meta/count/subroutine/sloc/7` | 2-8 |
| `meta/count/variety/***` | 2-8 |
| `meta/count/variety/3` | 2-8 |
| `meta/program` | 2-8 |
| `operator/arithmetic/addition` | 7 |
| `style/procedural` | 2-8 |
Expand Down
2 changes: 1 addition & 1 deletion docs/cli_collect.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h2 id="options">Options</h2>
-t --taxonomy=PATH The path of a TSV file mapping labels onto taxa. If not
specified, use the &quot;taxonomy.tsv&quot; present in DIRECTORY's
parent. If absent, use the included default taxonomy:
&lt;https://github.com/laowantong/paroxython/blob/0.6.2/paroxython/resources/taxonomy.tsv&gt;
&lt;https://github.com/laowantong/paroxython/blob/0.6.3/paroxython/resources/taxonomy.tsv&gt;
</pre>
<details class="source">
<summary>
Expand Down
4 changes: 2 additions & 2 deletions docs/cli_recommend.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ <h2 id="example">Example</h2>
return print(&#34;\n&#34;.join(sorted(rec.selected_programs - rec.hidden_programs)))
output_path = Path(args[&#34;--output&#34;] or parent_path / f&#34;{prefix}recommendations.md&#34;)
output_path.write_text(rec.get_markdown())
print_success(f&#34;Dumped: {output_path.resolve()}.\n&#34;)</code></pre>
print_success(f&#34;Dumped: {output_path.resolve()}\n&#34;)</code></pre>
</details>
</section>
<section>
Expand Down Expand Up @@ -226,7 +226,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
return print(&#34;\n&#34;.join(sorted(rec.selected_programs - rec.hidden_programs)))
output_path = Path(args[&#34;--output&#34;] or parent_path / f&#34;{prefix}recommendations.md&#34;)
output_path.write_text(rec.get_markdown())
print_success(f&#34;Dumped: {output_path.resolve()}.\n&#34;)</code></pre>
print_success(f&#34;Dumped: {output_path.resolve()}\n&#34;)</code></pre>
</details>
</dd>
</dl>
Expand Down
2 changes: 1 addition & 1 deletion docs/cli_tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h2 id="options">Options</h2>
-l --labels Output the labels instead of the taxa.
-t --taxonomy=PATH The path of a TSV file mapping labels onto taxa.
If not specified, use the included default taxonomy:
&lt;https://github.com/laowantong/paroxython/blob/0.6.2/paroxython/resources/taxonomy.tsv&gt;
&lt;https://github.com/laowantong/paroxython/blob/0.6.3/paroxython/resources/taxonomy.tsv&gt;
</pre>
<details class="source">
<summary>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ <h3 id="ipython-magic-command">IPython magic command</h3>
<p>If you use Jupyter notebook/lab, you've also just installed a so-called magic command. Load it like this:</p>
<pre><code class="python">%load_ext paroxython
</code></pre>
<p>This should print <code>"paroxython 0.6.2 loaded."</code>. Run it on a cell of Python code:</p>
<p>This should print <code>"paroxython 0.6.3 loaded."</code>. Run it on a cell of Python code:</p>
<pre><code class="python">%%paroxython # Lines
def fibonacci(n): # 2
result = [] # 3
Expand Down Expand Up @@ -181,7 +181,7 @@ <h3 id="ipython-magic-command">IPython magic command</h3>
<td align="left">2-8</td>
</tr>
<tr>
<td align="left"><code>meta/count/variety/***</code></td>
<td align="left"><code>meta/count/variety/3</code></td>
<td align="left">2-8</td>
</tr>
<tr>
Expand Down
12 changes: 7 additions & 5 deletions docs/label_programs.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1 class="title">Module <code>paroxython.label_programs</code></h1>
<details class="source">
<summary>
<span>Expand source code</span>
<a href="https://github.com/laowantong/paroxython/blob/master/paroxython/label_programs.py#L0-L86" class="git-link">Browse GitHub</a>
<a href="https://github.com/laowantong/paroxython/blob/master/paroxython/label_programs.py#L0-L87" class="git-link">Browse GitHub</a>
</summary>
<pre><code class="python">from pathlib import Path
from typing import Callable, Iterator, List, Set
Expand All @@ -45,12 +45,13 @@ <h1 class="title">Module <code>paroxython.label_programs</code></h1>

def labelled_programs(
directory: Path,
search_imported_program_path: Callable = regex.compile(r&#34;import(?:_module)?:([^:]+)&#34;).search,
search_imported_program_path: Callable = regex.compile(r&#34;import(?:_module)?:([^:]*)&#34;).search,
print_performances: bool = False,
**kwargs,
) -&gt; Programs:
programs: Programs = list_programs(directory, **kwargs)
internal_program_paths = {p.path.replace(&#34;/&#34;, &#34;.&#34;) for p in programs} # path sep -&gt; import sep
internal_program_paths.add(&#34;.py&#34;) # for `from . import foobar`, the module name will be &#34;&#34;
parse = ProgramParser()
print(f&#34;Labelling {len(programs)} programs.&#34;)
for program in iterate_and_print_programs(programs):
Expand Down Expand Up @@ -126,16 +127,17 @@ <h2 id="note">Note</h2>
<details class="source">
<summary>
<span>Expand source code</span>
<a href="https://github.com/laowantong/paroxython/blob/master/paroxython/label_programs.py#L13-L51" class="git-link">Browse GitHub</a>
<a href="https://github.com/laowantong/paroxython/blob/master/paroxython/label_programs.py#L13-L52" class="git-link">Browse GitHub</a>
</summary>
<pre><code class="python">def labelled_programs(
directory: Path,
search_imported_program_path: Callable = regex.compile(r&#34;import(?:_module)?:([^:]+)&#34;).search,
search_imported_program_path: Callable = regex.compile(r&#34;import(?:_module)?:([^:]*)&#34;).search,
print_performances: bool = False,
**kwargs,
) -&gt; Programs:
programs: Programs = list_programs(directory, **kwargs)
internal_program_paths = {p.path.replace(&#34;/&#34;, &#34;.&#34;) for p in programs} # path sep -&gt; import sep
internal_program_paths.add(&#34;.py&#34;) # for `from . import foobar`, the module name will be &#34;&#34;
parse = ProgramParser()
print(f&#34;Labelling {len(programs)} programs.&#34;)
for program in iterate_and_print_programs(programs):
Expand Down Expand Up @@ -172,7 +174,7 @@ <h2 id="note">Note</h2>
<details class="source">
<summary>
<span>Expand source code</span>
<a href="https://github.com/laowantong/paroxython/blob/master/paroxython/label_programs.py#L54-L81" class="git-link">Browse GitHub</a>
<a href="https://github.com/laowantong/paroxython/blob/master/paroxython/label_programs.py#L55-L82" class="git-link">Browse GitHub</a>
</summary>
<pre><code class="python">def generate_labelled_sources(programs: Programs) -&gt; Iterator:
separator = &#34;-&#34; * 88
Expand Down
12 changes: 6 additions & 6 deletions docs/make_db.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h1 class="title">Module <code>paroxython.make_db</code></h1>
def write_json(self, db_path: Optional[Path] = None) -&gt; None:
db_path = db_path or self.directory.parent / f&#34;{self.directory.name}_db.json&#34;
db_path.write_text(self.get_json())
print_success(f&#34;Dumped: {db_path.absolute()}.&#34;)
print_success(f&#34;Dumped: {db_path.absolute()}&#34;)

def write_sqlite(self, db_path: Optional[Path] = None) -&gt; None:
db_path = db_path or self.directory.parent / f&#34;{self.directory.name}_db.sqlite&#34;
Expand Down Expand Up @@ -190,7 +190,7 @@ <h1 class="title">Module <code>paroxython.make_db</code></h1>
connexion.commit()
connexion.close()

print_success(f&#34;Dumped: {db_path.absolute()}.&#34;)
print_success(f&#34;Dumped: {db_path.absolute()}&#34;)


def collect_labels(programs: Programs) -&gt; LabelInfos:
Expand Down Expand Up @@ -629,7 +629,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
def write_json(self, db_path: Optional[Path] = None) -&gt; None:
db_path = db_path or self.directory.parent / f&#34;{self.directory.name}_db.json&#34;
db_path.write_text(self.get_json())
print_success(f&#34;Dumped: {db_path.absolute()}.&#34;)
print_success(f&#34;Dumped: {db_path.absolute()}&#34;)

def write_sqlite(self, db_path: Optional[Path] = None) -&gt; None:
db_path = db_path or self.directory.parent / f&#34;{self.directory.name}_db.sqlite&#34;
Expand Down Expand Up @@ -712,7 +712,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
connexion.commit()
connexion.close()

print_success(f&#34;Dumped: {db_path.absolute()}.&#34;)</code></pre>
print_success(f&#34;Dumped: {db_path.absolute()}&#34;)</code></pre>
</details>
<h3>Methods</h3>
<dl>
Expand Down Expand Up @@ -857,7 +857,7 @@ <h2 id="args">Args</h2>
<pre><code class="python">def write_json(self, db_path: Optional[Path] = None) -&gt; None:
db_path = db_path or self.directory.parent / f&#34;{self.directory.name}_db.json&#34;
db_path.write_text(self.get_json())
print_success(f&#34;Dumped: {db_path.absolute()}.&#34;)</code></pre>
print_success(f&#34;Dumped: {db_path.absolute()}&#34;)</code></pre>
</details>
</dd>
<dt id="paroxython.make_db.TagDatabase.write_sqlite"><code class="name flex">
Expand Down Expand Up @@ -961,7 +961,7 @@ <h2 id="description">Description</h2>
connexion.commit()
connexion.close()

print_success(f&#34;Dumped: {db_path.absolute()}.&#34;)</code></pre>
print_success(f&#34;Dumped: {db_path.absolute()}&#34;)</code></pre>
</details>
</dd>
</dl>
Expand Down
4 changes: 2 additions & 2 deletions docs/map_taxonomy.html
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,9 @@ <h2 id="description">Description</h2>
<li><code>self.compiled_labels</code> is a list of couples, of which the first member is a
<strong>compiled</strong> label pattern, and the second member is a replacement pattern which may
contain backreferences to one or several capture groups of the label pattern. For
instance, it can include the couple <code>(regex.compile(r"nested_index:(\d+)$"),
instance, it can include the couple <code>(regex.compile(r"index_shape:(\d+)$"),
r"subscript/index/shape/\1")</code>, which will be used to “translate” any occurrence of
the label name <code>"nested_index:3"</code> into the taxon name <code>"subscript/index/shape/3"</code>.
the label name <code>"index_shape:3"</code> into the taxon name <code>"subscript/index/shape/3"</code>.
As an associative list, it only allows O(n) lookups a given label pattern.</li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion docs/recommend_programs.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ <h2 id="description">Description</h2>
rec.run_pipeline(ast.literal_eval(Path(f&#34;{path}_pipe.py&#34;).read_text()))
output_path = Path(f&#34;{path}_recommendations.md&#34;)
output_path.write_text(rec.get_markdown())
print(f&#34;Dumped: {output_path.resolve()}.\n&#34;)</code></pre>
print(f&#34;Dumped: {output_path.resolve()}\n&#34;)</code></pre>
</details>
</section>
<section>
Expand Down
6 changes: 3 additions & 3 deletions docs/resources/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,11 @@ var data = google.visualization.arrayToDataTable([['node', 'occurrences'],
['🐍 style unpythonic find_best_element_index.', 1],
['🐍 style unpythonic swap.', 13],
['🐍 style unpythonic yoda_comparison.', 6],
['🐍 subscript index.', 2364],
['🐍 subscript index.', 2370],
['🐍 subscript index arithmetic.', 299],
['🐍 subscript index backwards last.', 25],
['🐍 subscript index shape 2.', 392],
['🐍 subscript index shape 3.', 14],
['🐍 subscript index shape 2.', 396],
['🐍 subscript index shape 3.', 12],
['🐍 subscript slice copy.', 14],
['🐍 subscript slice start.', 94],
['🐍 subscript slice step backwards.', 15],
Expand Down
6 changes: 3 additions & 3 deletions docs/user_manual/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,11 @@
['🐍 style unpythonic find_best_element_index.', 1],
['🐍 style unpythonic swap.', 13],
['🐍 style unpythonic yoda_comparison.', 6],
['🐍 subscript index.', 2364],
['🐍 subscript index.', 2370],
['🐍 subscript index arithmetic.', 299],
['🐍 subscript index backwards last.', 25],
['🐍 subscript index shape 2.', 392],
['🐍 subscript index shape 3.', 14],
['🐍 subscript index shape 2.', 396],
['🐍 subscript index shape 3.', 12],
['🐍 subscript slice copy.', 14],
['🐍 subscript slice start.', 94],
['🐍 subscript slice step backwards.', 15],
Expand Down
2 changes: 1 addition & 1 deletion paroxython/cli_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
-t --taxonomy=PATH The path of a TSV file mapping labels onto taxa. If not
specified, use the "taxonomy.tsv" present in DIRECTORY's
parent. If absent, use the included default taxonomy:
https://github.com/laowantong/paroxython/blob/0.6.2/paroxython/resources/taxonomy.tsv
https://github.com/laowantong/paroxython/blob/0.6.3/paroxython/resources/taxonomy.tsv
```
"""

Expand Down
2 changes: 1 addition & 1 deletion paroxython/cli_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-l --labels Output the labels instead of the taxa.
-t --taxonomy=PATH The path of a TSV file mapping labels onto taxa.
If not specified, use the included default taxonomy:
https://github.com/laowantong/paroxython/blob/0.6.2/paroxython/resources/taxonomy.tsv
https://github.com/laowantong/paroxython/blob/0.6.3/paroxython/resources/taxonomy.tsv
```
"""

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "paroxython"
version = "0.6.2"
version = "0.6.3"
description = "Search Python code for algorithmic features"
authors = ["Aristide Grange"]
license = "MIT"
Expand Down

0 comments on commit 4626798

Please sign in to comment.