Skip to content

Commit 21a22cf

Browse files
authored
Merge pull request #196 from kayjan/benchmark-precision
Benchmark precision
2 parents b415ad0 + 67e5389 commit 21a22cf

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

.github/workflows/codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ jobs:
6060
github-token: ${{ secrets.GITHUB_TOKEN }}
6161
comment-always: true
6262
summary-always: true
63+
- name: Clear previous benchmark report
64+
if: ${{ github.event_name == 'push' }}
65+
run: |
66+
gh cache delete ${{ runner.os }}-benchmark
6367
- name: Upload coverage to Codecov
6468
if: ${{ github.event_name == 'push' }}
6569
uses: codecov/codecov-action@v3

pyproject.toml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,8 @@ mypy-type = "mypy bigtree"
7474
[tool.hatch.envs.docs]
7575
dependencies = [
7676
"autodocsumm==0.2.11",
77-
"myst-parser~=1.0.0",
7877
"IPython",
79-
"pandas",
80-
"pydot",
81-
"Pillow",
78+
"myst-parser~=1.0.0",
8279
"sphinxcontrib-mermaid==0.9.2",
8380
"sphinxemoji==0.2.0",
8481
"sphinx-material==0.0.36"
@@ -93,18 +90,15 @@ clean-html = "sphinx-build -M html docs_sphinx/source docs_sphinx/build & sphinx
9390

9491
[tool.hatch.envs.mkdocs]
9592
dependencies = [
93+
"black",
94+
"docstr-coverage",
95+
"IPython",
9696
"mkdocs==1.5.3",
9797
"mkdocs-material[imaging]==9.5.5",
9898
"mdx_truly_sane_lists",
9999
"mkdocstrings[python]",
100-
"docstr-coverage",
101100
"mkdocs-glightbox",
102101
"termynal",
103-
"black",
104-
"IPython",
105-
"pandas",
106-
"pydot",
107-
"Pillow",
108102
]
109103

110104
[tool.hatch.envs.mkdocs.scripts]

tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,18 @@ def phylogenetic_tree():
537537
return root
538538

539539

540+
def pytest_benchmark_scale_unit(config, unit, benchmarks, best, worst, sort):
541+
prefix = ""
542+
if unit == "seconds":
543+
scale = 1.0
544+
elif unit == "operations":
545+
scale = 0.001
546+
else:
547+
raise RuntimeError("Unexpected measurement unit %r" % unit)
548+
549+
return prefix, scale
550+
551+
540552
def assert_print_statement(func, expected, *args, **kwargs):
541553
captured_output = io.StringIO()
542554
sys.stdout = captured_output

0 commit comments

Comments
 (0)