Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8d015a4
chore(rename): rename project from template.
Spill-Tea Jul 17, 2025
24c0a6f
chore(pyproject): Update project metadata.
Spill-Tea Jul 18, 2025
1cf5311
docs(readme): Update readme.
Spill-Tea Jul 18, 2025
52cb915
docs(source): Fix docs post renaming. Remove irrelevant sample docume…
Spill-Tea Jul 22, 2025
04389f2
chore(configs): Update project config and requirements.
Spill-Tea Jul 23, 2025
1c77c58
feat(handlers): Implement json and file stream handlers, and custom e…
Spill-Tea Aug 14, 2025
7d97ce6
chore(precommit): Update addlicense precommit hook.
Spill-Tea Aug 14, 2025
ffc4b8b
chore(license): add license to new files.
Spill-Tea Aug 14, 2025
9914395
feat(sifter): Include module of methods to collect and load new bench…
Spill-Tea Aug 15, 2025
befd5d6
feat(sifter): Include module of methods to collect and load new bench…
Spill-Tea Aug 15, 2025
9492950
feat(utils): common or miscellaneous utility functions.
Spill-Tea Aug 16, 2025
fa3fff2
fix(utils): add licensen.
Spill-Tea Aug 16, 2025
3396015
feat(complexity): Implement methods to calculate algorithmic complexity.
Spill-Tea Aug 16, 2025
c88f5a8
feat(3.11): Update python requirement to minimum of 3.11.
Spill-Tea Aug 17, 2025
9a67354
ci(workflow): Include python 3.13 in workflow matrix unit testing.
Spill-Tea Aug 17, 2025
4668cdf
ci(workflow): Upgrade addlicense version to match pre commit version.
Spill-Tea Aug 17, 2025
5497977
feat(structure): Include module to organize json output of google ben…
Spill-Tea Aug 17, 2025
f794f8a
feat(plotting): Implement functions to build plotly figures.
Spill-Tea Aug 17, 2025
5a8996d
feat(structure): Implement methods to convert structured dataclass to…
Spill-Tea Aug 24, 2025
48f5f69
feat(config): Implement a basic config with toml tool support.
Spill-Tea Aug 25, 2025
77a7a48
feat(runner): Implement initial prototype of benchmark runner and cli…
Spill-Tea Aug 25, 2025
9cdd3c6
test(structure): Implement unit tests for new to_json methods for dat…
Spill-Tea Aug 25, 2025
4388607
chore(lint): Lint project appropriately.
Spill-Tea Aug 25, 2025
72f0563
chore(config): static typing.
Spill-Tea Aug 25, 2025
50deece
test(config): Improve config api to make unit testing more straightfo…
Spill-Tea Aug 25, 2025
1dcc71f
test(config): Use a context manager to reset config class across unit…
Spill-Tea Aug 25, 2025
4633207
test(sifter): Improve sifter collection interface to facilitate facil…
Spill-Tea Aug 25, 2025
8477930
tests(integration): Include Integration tests.
Spill-Tea Aug 26, 2025
8939e39
tests(plotting): Complete unit testing of plotting module.
Spill-Tea Aug 26, 2025
aa6d78b
fix(runner): Fix pyproject toml file path name.
Spill-Tea Aug 26, 2025
26285b4
test(structure): Include additional testing coverage of structure mod…
Spill-Tea Aug 26, 2025
08e6984
test(runner): Implement unit and additional integration tests of runn…
Spill-Tea Aug 26, 2025
54e50d7
fix(structure): Include additional key aslr_enabled in BenchmarkConte…
Spill-Tea Aug 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false

steps:
- name: Checkout PyTemplate Project
- name: Checkout BenchMatcha Project
uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: PyTemplate CI
name: BenchMatcha CI

on:
push:
Expand All @@ -16,7 +16,7 @@ jobs:
fail-fast: false

steps:
- name: Checkout PyTemplate Project
- name: Checkout BenchMatcha Project
uses: actions/checkout@v4

- name: Set up Python
Expand Down Expand Up @@ -45,10 +45,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11", "3.12" ]
python-version: [ "3.11", "3.12", "3.13" ]

steps:
- name: Checkout PyTemplate Project
- name: Checkout BenchMatcha Project
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:

- name: Install addlicense
run: |
go install github.com/google/addlicense@v1.1.1
go install github.com/google/addlicense@v1.2.0

- name: Check for License Headers
run: |
Expand Down
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ repos:
args: [ --maxkb=1024 ]
- id: requirements-txt-fixer

- repo: https://github.com/Spill-Tea/addlicense-pre-commit
rev: v1.1.2
- repo: https://github.com/google/addlicense
rev: v1.2.0
hooks:
- id: addlicense
language: golang
args: [
-f, LICENSE,
]
Expand Down
78 changes: 27 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,52 @@
# PyTemplate
# BenchMatcha
[![build status][buildstatus-image]][buildstatus-url]

[buildstatus-image]: https://github.com/Spill-Tea/PyTemplate/actions/workflows/python-app.yml/badge.svg?branch=main
[buildstatus-url]: https://github.com/Spill-Tea/PyTemplate/actions?query=branch%3Amain
[buildstatus-image]: https://github.com/Spill-Tea/BenchMatcha/actions/workflows/python-app.yml/badge.svg?branch=main
[buildstatus-url]: https://github.com/Spill-Tea/BenchMatcha/actions?query=branch%3Amain

Python Project Template. Be sure to create a template directly
from github.
![logo](docs/source/_static/logo.svg)

BenchMatcha is your companion pytest-like runner to google benchmarks.
Analyze, plot, and save your results over time to evaluate regression
over the lifetime of a project.

<!-- omit in toc -->
## Table of Contents
- [PyTemplate](#pytemplate)
- [Using this template](#using-this-template)
- [Manual Editing of Project Template](#manual-editing-of-project-template)
- [BenchMatcha](#benchmatcha)
- [Installation](#installation)
- [Install from pypi](#install-from-pypi)
- [Clone the repository](#clone-the-repository)
- [Pip install directly from github.](#pip-install-directly-from-github)
- [Development](#development)
- [For Developers](#for-developers)
- [License](#license)

## Using this template
Create a new repository using the `Use this template` option available on github.
Clone that new repository (e.g. `mynewproject`), and run the helper script `rename.py`.

```bash
git clone https://github.com/<username>/<projectname>.git
cd <projectname>
python rename.py --old-name PyTemplate --new-name <projectname>

```
We provide a simple helper script `rename.py` in the root directory to help rename a few
files and directory names to make your life easier. Please note that you will still need
to manually adjust the `pyproject.toml` file, specifically the `[project]` and
`[project.urls]` keys, to reflect your new project metadata.

Also manually update the `docs/source/conf.py` file to reflect correct `author`,
`copyright`, and `release` key metadata for documentation builds.

Finally update this `README.md` document to reflect new project urls.

### Manual Editing of Project Template
To summarize, after running the `rename.py` script, there are three files you may need
to manually adjust for your new project:

1. `pyproject.toml` --> update metadata
1. `docs/source/conf.py` --> update metadata
1. `README.md` --> update project urls (and license type if different)

Note: If you need to update the `LICENSE` file, you will also need to edit the license
header from files throughout the `src/` and `tests/` directories.

PRO-TIP: you could theoretically run the helper script several times to replace the
project name, author name, email, and (github) username. Something like:
## Installation
You have options.

### Install from pypi
```bash
python rename.py --old-name PyTemplate --new-name <project_name>
python rename.py --old-name 'Jason C Del Rio' --new-name <author_name>
python rename.py --old-name [email protected] --new-name <author_email>
python rename.py --old-name Spill-Tea --new-name <github_user_name>
pip install BenchMatcha
```

## Installation
Clone the repository and pip install.

### Clone the repository
```bash
git clone https://github.com/Spill-Tea/PyTemplate.git
cd PyTemplate
git clone https://github.com/Spill-Tea/BenchMatcha.git
cd BenchMatcha
pip install .
```

Alternatively, you may install directly from github.
### Pip install directly from github.
```bash
pip install git+https://github.com/Spill-Tea/PyTemplate@main
pip install git+https://github.com/Spill-Tea/BenchMatcha@main
```

## Development

BenchMatcha is currently in the planning stages of development. This means the project
is not ready for production use, and may be prone to change api without much notice.


## For Developers
After cloning the repository, create a new virtual environment and run the following
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_templates/redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<title>Redirecting to main development branch</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; URL=./main/index.html">
<link rel="canonical" href="https://Spill-Tea.github.io/PyTemplate/main/index.html">
<link rel="canonical" href="https://Spill-Tea.github.io/BenchMatcha/main/index.html">
</head>
</html>
148 changes: 3 additions & 145 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
@@ -1,149 +1,7 @@
PyTemplate API Documentation
============================
BenchMatcha API Documentation
=============================

PyTemplate API documentation.

Here are python and cython code snippets to demonstrate the use of respective customized
lexers with custom syntax highlighting style. These examples are not necessarily meant
to be fully valid code, but to demonstrate key features not available through standard
pygments syntax highlighting styles.

Python Example Snippet
----------------------

.. code-block:: python
:caption: example.py

#!/usr/bin/env python3
"""Module level docstring."""
from typing import ClassVar
import numpy as np

CONSTANT_A: int = 0xFF
CONSTANT_B: float = np.pi

# NOTE: this is an example class
class Example(object):
"""Example docstring.

Args:
arg1 (str): argument 1
arg2 (int): argument 2

Attributes:
data (dict): data

"""
arg1: str
arg2: int
data: dict
seventeen: ClassVar[list[int]] = [17, 0x11, 0o21, 0b10001]
other: ClassVar[list[int]] = [1e-5, 1.0e+3, 2j, 2l, 2.7E4J]

def __init__(self, arg1: str, arg2: int) -> None:
self.arg1 = arg1
self.arg2 = arg2
self.data = {
"a": [(1, 2, (3, 4, 5)), (6, 7, (8, 9 , 10))],
"b": {"c": (7, 4, 3), "d": {"e", "f", "g"}},
}

def __getattr__(self, value):
return self.method(value)

def method(self, value):
return self.data[value]

def write(self, text):
print(f"{text:<5}\n")

def do_something(self, value):
if value > CONSTANT_A:
return value - CONSTANT_B
else:
return value + 0b10011


Cython Example Snippet
----------------------

.. code-block:: cython
:caption: example.pyx

"""Module level docstring."""
import cython
from libc.stdlib cimport free, malloc

cdef extern from "<vector>" namespace "std":
cdef cppclass vector[T]:
vector()
T& operator[](int)

ctypedef fused StringTypeObject:
str
bytes

ctypedef struct CustomStruct:
int y
str z

cdef packed struct Breakfast:
int[4] spam
signed char[5] eggs

cdef enum CheeseType:
manchego = 1
gouda = 2
camembert = 3

cdef union MyUnion:
int i
float f
char c

cdef inline unsigned char* function(bint flag) noexcept:
cdef:
Py_ssize_t j
unsigned char* k = NULL

k = <unsigned char*> malloc(5 * sizeof(unsigned char))

for j in range(5):
k[j] = "A"

return k

# XXX: this is an example class
cdef class Example:
"""The little example class that couldn't.

Args:
arg1 (unsigned long long): ...
arg2 (double): ...

"""
cdef public unsigned long long v
cdef readonly double k
cdef char* mem

def __cinit__(self, unsigned long long arg1, double arg2):
self.v = arg1
self.k = arg2
self.mem = <char*> malloc(5 * sizeof(char))

def __dealloc__(self):
free(self.mem)

@cython.boundscheck(False)
cdef char index(self, size_t idx):
return self.mem[idx]

# just an example of nested parenthesis to demonstrate rainbow coloring
cdef dict obj = {
"a": [(1, 2, (3, 4, 5)), (6, 7, (8, 9 , 10))],
"b": {"c": (7, 4, 3), "d": {"e", "f", "g"}},
}
cdef tuple builtin_constants = (True, False, NULL, None,)
BenchMatcha API documentation.


.. toctree::
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "PyTemplate"
project = "BenchMatcha"
copyright = "2025, Jason C Del Rio (Spill-Tea)"
author = "Jason C Del Rio (Spill-Tea)"
release = "v0.0.1"
Expand Down Expand Up @@ -85,7 +85,7 @@
html_static_path = ["_static"]
html_css_files = ["custom.css"]
# html_logo = "_static/logo.svg"
github_url = "https://github.com/Spill-Tea/PyTemplate"
github_url = "https://github.com/Spill-Tea/BenchMatcha"

# Theme options
html_theme_options = {
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PyTemplate documentation
========================
BenchMatcha documentation
=========================

Include text here.

Expand Down
Loading
Loading