diff --git a/docs/_build/_images/coverage.svg b/docs/_build/_images/coverage.svg index 927a721..b2f4e17 100644 --- a/docs/_build/_images/coverage.svg +++ b/docs/_build/_images/coverage.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/docs/_build/builder/builder.html b/docs/_build/builder/builder.html index d8ce52f..0342d62 100644 --- a/docs/_build/builder/builder.html +++ b/docs/_build/builder/builder.html @@ -257,12 +257,12 @@
Adds the sequence to the tree.
+Add the sequence to the tree.
Set a progress indicator callback function.
You should not change the tree in this callback.
A Generalized Suffix Tree.
A generalized suffix tree.
The key feature of the suffix tree is that for any leaf \(i\), the concatenation of the edgle-labels on the path from the root to leaf @@ -283,12 +283,13 @@
Initialize and optionally build the tree.
d (Dict[Id, Symbols]) – a dictionary of ids to sequences of symbols or None
data (Dict[Id, Symbols]) – a dictionary of ids to sequences of symbols +or None
builder (builder.Builder) – a builder
(default = suffix_tree.ukkonen.Builder
)
progress (Callable) – a progress function (default = None). The function diff --git a/docs/make_badges.py b/docs/make_badges.py index 2ddb95c..e182fb5 100755 --- a/docs/make_badges.py +++ b/docs/make_badges.py @@ -14,47 +14,51 @@ # shields_io_colors = ["success", "important", "critical", "informational", "inactive"] -badges = {} +if __name__ == "main": + badges = {} -# one build=passing badge for each python version -for filename in glob.glob(".tox/py*/log/2-commands*.log"): - with open(filename, "r") as fp: - status = "passing" - color = "success" - for line in fp: - if line.startswith("name: "): - name = line[6:].strip() - if line.startswith("==="): - if m := re.search(r"(\d+) failed", line): + # one build=passing badge for each python version + for filename in glob.glob(".tox/py*/log/*commands*.log"): + with open(filename, "r") as fp: + status = "passing" + color = "success" + for line in fp: + if line.startswith("name: "): + name = line[6:].strip() + if m := re.search(r"===.*(\d+) failed", line): failed = int(m.group(1)) status = "failed" color = "critical" - badge = requests.get(f"https://img.shields.io/badge/{name}-{status}-{color}").text - filename = f"_images/tox-{name}.svg" - with open(f"{DESTDIR}{filename}", "w") as dest: - dest.write(badge) - print(f"{filename}") + badge = requests.get( + f"https://img.shields.io/badge/{name}-{status}-{color}" + ).text + filename = f"_images/tox-{name}.svg" + with open(f"{DESTDIR}{filename}", "w") as dest: + dest.write(badge) + print(f"{filename}") - badges[name] = f"{REFDIR}{filename}" + badges[name] = f"{REFDIR}{filename}" -# one coverage badge -with open("htmlcov/index.html") as fp: - root = etree.parse(fp, parser=etree.HTMLParser()).getroot() + # one coverage badge + with open("htmlcov/index.html") as fp: + root = etree.parse(fp, parser=etree.HTMLParser()).getroot() -coverage = root.xpath("//span[@class='pc_cov']")[0].text + coverage = root.xpath("//span[@class='pc_cov']")[0].text -cov = int(coverage.rstrip("%")) -if cov > 95: - color = "success" -elif cov > 75: - color = "important" -else: - color = "critical" + cov = int(coverage.rstrip("%")) + if cov > 95: + color = "success" + elif cov > 75: + color = "important" + else: + color = "critical" -badge = requests.get(f"https://img.shields.io/badge/coverage-{coverage}-{color}").text + badge = requests.get( + f"https://img.shields.io/badge/coverage-{coverage}-{color}" + ).text -filename = "_images/coverage.svg" -with open(f"{DESTDIR}{filename}", "w") as dest: - dest.write(badge) - print(f"{filename}") - badges["coverage"] = f"{REFDIR}{filename}" + filename = "_images/coverage.svg" + with open(f"{DESTDIR}{filename}", "w") as dest: + dest.write(badge) + print(f"{filename}") + badges["coverage"] = f"{REFDIR}{filename}" diff --git a/tests/unit/test_builder_factory.py b/tests/unit/test_builder_factory.py index f766959..7c73bcb 100644 --- a/tests/unit/test_builder_factory.py +++ b/tests/unit/test_builder_factory.py @@ -11,4 +11,5 @@ def test_builder_factory(self): assert builder_factory("mccreight") == mccreight.Builder assert builder_factory("ukkonen") == ukkonen.Builder assert builder_factory("naive") == naive.Builder + assert builder_factory("foo") == mccreight.Builder assert builder_factory() == mccreight.Builder