Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
91612af
feat: add list datasets and test
ddevin96 May 20, 2026
4f82287
fix: correct name
ddevin96 May 20, 2026
af80a87
fix: explicit utf8
ddevin96 May 20, 2026
0ad7a8b
fix: propagate utf-8
ddevin96 May 20, 2026
3b0febb
chore: add integration test utilities and exclude from coverage
ddevin96 May 20, 2026
786d20d
chore: move tests in proper place - add support for parallel testing
ddevin96 May 20, 2026
1a74ed2
fix: removing choiche of test
ddevin96 May 20, 2026
f50d407
chore: organize integration test files structure - add make file util…
ddevin96 May 21, 2026
fffc490
chore: common for integrations
ddevin96 May 22, 2026
f947992
feat: adding integration test for each hlp module
ddevin96 May 22, 2026
e5cf4b9
chore: integration test structure
ddevin96 May 22, 2026
894e1df
fix: add models to integration test
ddevin96 May 22, 2026
4093696
feat: finished modules
ddevin96 May 22, 2026
1f87475
docs: fixed docs for integration tests
ddevin96 May 22, 2026
4f1d3fb
fix: correcting pre-commit hook - fix import in integration
ddevin96 May 25, 2026
9edf06b
fix: correcting PR comments
ddevin96 May 25, 2026
5b9e442
fix: correcting PR comments
ddevin96 May 25, 2026
6ca06e1
fix: correcting import
ddevin96 May 25, 2026
91089f9
fix: correcting import
ddevin96 May 25, 2026
aa6cb46
chore: finalize integration test
ddevin96 May 26, 2026
de16c76
fix: add generator for custom seed in integration test
ddevin96 May 26, 2026
e240516
fix: refactor integration
ddevin96 May 26, 2026
38d759c
fix: correcting supported_dataset
ddevin96 May 26, 2026
23ee99a
fix: remove comments
ddevin96 May 26, 2026
f85bacf
fix: removed comments
ddevin96 May 26, 2026
c78f5c5
fix: correct import sort
ddevin96 May 26, 2026
aef16ba
fix: add test for enricher
ddevin96 May 26, 2026
a1175a5
fix: add script to count cutoff - real threshold for integration tests
ddevin96 May 26, 2026
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
21 changes: 15 additions & 6 deletions .github/hooks/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,27 @@ repos:

- repo: local
hooks:
- id: uvx-ruff-format
name: uvx ruff format
entry: bash -c 'uvx ruff format'
- id: uv-run-typecheker
name: uv run ty check
language: system
entry: bash -c 'uv run ty check'
types_or: [python, pyi]
require_serial: true

- repo: local
hooks:
- id: uvx-ty-check
name: uvx ty check
entry: bash -c 'uvx ty check'
- id: uv-ruff-linter
name: uv run ruff check
language: system
entry: bash -c 'uv run ruff check'
types_or: [python, pyi]
require_serial: true

- repo: local
hooks:
- id: uv-ruff-formatter
name: uv run ruff format
language: system
entry: bash -c 'uv run ruff format'
types_or: [python, pyi]
require_serial: true
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ jobs:
run: |
make test
- name: Run integration tests with pytest
run: |
make i-test
test-arm:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ jobs:
run: |
make build

- name: Run tests with coverage
- name: Run unit tests with coverage
run: |
uv run pytest --cov --cov-branch --cov-report=xml
uv run pytest -n auto --cov --cov-branch --cov-report=xml -m "not integration"

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Test with pytest
- name: Run unit tests for Codecov
run: |
uv run pytest --cov --junitxml=junit.xml
uv run pytest -n auto --cov --junitxml=junit.xml -m "not integration"

- name: Upload test results to Codecov
uses: codecov/codecov-action@v5
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:

jobs:
validate-issue-labels:
environment:
name: management
runs-on: ubuntu-latest
permissions:
issues: write
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/pull_requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:

jobs:
label:
environment:
name: management
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -20,8 +18,6 @@ jobs:
sync-labels: true

assignees:
environment:
name: management
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
29 changes: 21 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: all build setup setup-tensorboard clean destroy \
test stest run \
.PHONY: all release build setup setup-tensorboard clean destroy \
test stest i-test si-test run \
check format typecheck lint lint-fix lint-rule lint-rule-fix \
docs docs-build docs-serve \
loc help
Expand All @@ -14,6 +14,8 @@ DOCS_ADDR=127.0.0.1:8000

all: clean setup check test

release: clean setup check test i-test

build: clean setup

setup:
Expand Down Expand Up @@ -56,12 +58,20 @@ lint-rule-fix:
$(UV) run $(LINTER) check --select $(R) --fix

test:
@echo '=== Tests ==='
$(UV) run $(PYTEST) --cov=$(PROJECT_NAME) --cov-report=term-missing
@echo '=== Running unit tests in parallel ==='
$(UV) run $(PYTEST) -n auto --cov=$(PROJECT_NAME) --cov-report=term-missing -m "not integration"

stest:
@echo '=== Test for $(T) ==='
$(UV) run $(PYTEST) -s $(PROJECT_NAME)/tests/$(T)
@echo '=== Running single unit test for $(T) ==='
$(UV) run $(PYTEST) -n auto -s $(PROJECT_NAME)/tests/$(T)

i-test:
@echo '=== Running integration tests in parallel ==='
$(UV) run $(PYTEST) -n auto -m "integration"

si-test:
@echo '=== Running single integration test for $(T) ==='
$(UV) run $(PYTEST) -n auto -s $(PROJECT_NAME)/integration_tests/$(T) -m "integration"

# If the first argument is run...
ifeq ($(firstword $(MAKECMDGOALS)),run)
Expand Down Expand Up @@ -104,6 +114,7 @@ help:
@echo "Usage: make [target]"
@echo "Targets:"
@echo " all - Clean, setup, lint, typecheck, test"
@echo " release - Clean, setup, lint, typecheck, test, i-test"
@echo " build - Clean and setup"
@echo " setup - Install dependencies"
@echo " setup-tensorboard - Install optional TensorBoard dependency"
Expand All @@ -115,8 +126,10 @@ help:
@echo " lint-fix - Run linting and fix issues"
@echo " lint-rule R=<rule> - Run linting for a specific rule (e.g., R=E501)"
@echo " lint-rule-fix R=<rule> - Run linting for a specific rule and fix issues"
@echo " test - Run all tests"
@echo " stest T=<test_name> - Run a single test"
@echo " test - Run all unit tests in parallel"
@echo " stest T=<test_name> - Run a single unit test"
@echo " i-test - Run integration tests in parallel"
@echo " si-test T=<test_name> - Run a single integration test"
@echo " run <file.py> - Run a single file"
@echo " docs - Build and serve documentation"
@echo " docs-build - Build documentation without serving"
Expand Down
2 changes: 2 additions & 0 deletions docs/agents/references/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- Prefer Makefile targets:
- `make test`
- `make stest T=<path-within-hyperbench/tests>`
- `make i-test`
- `make si-test T=<path-within-hyperbench/integration_tests>`
- Use `uv run pytest` only for targeted one-off runs.
- Run `make test` to see coverage reports and identify untested lines.

Expand Down
6 changes: 5 additions & 1 deletion docs/development/makefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ You can always run `make help` to see the latest list.
> Notes
>
> - These are the explicit CLI commands that each `make` target runs.
> - `make all`, `make build`, `make check`, `make docs` are composites (they run multiple steps).
> - `make all`, `make release`, `make build`, `make check`, `make docs` are composites (they run multiple steps).

| Target | Description |
|---|---|
| `make help` | Print available targets |
| `make all` | Clean, setup, check, test |
| `make release` | Clean, setup, check, test, i-test |
| `make build` | Clean and setup |
| `make setup` | Install dependencies (via `uv`) and install HyperBench in editable mode |
| `make setup-tensorboard` | Install optional TensorBoard extra |
Expand All @@ -26,6 +27,8 @@ You can always run `make help` to see the latest list.
| `make docstring-check` | Check docstring formatting |
| `make test` | Run all tests (with coverage) |
| `make stest T=<test_path>` | Run a single test file/folder under `hyperbench/tests/` |
| `make i-test` | Run all integration tests |
| `make si-test T=<test_path>` | Run a single integration test file/folder under `hyperbench/integration_tests/` |
| `make run <file.py>` | Run a single Python file (for example: `make run examples/gcn.py`) |
| `make docs` | Build and serve documentation |
| `make docs-build` | Build documentation without serving |
Expand Down Expand Up @@ -197,6 +200,7 @@ You can always run `make help` to see the latest list.
Utility targets that run multiple steps in sequence.

- `make all`: Clean, setup, check, test
- `make release`: Clean, setup, check, test, i-test
- `make build`: Clean and setup
- `make check`: Run lint + format + typecheck
- `make docs`: Build and serve documentation
3 changes: 0 additions & 3 deletions examples/hgnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
print(f"Val dataset:\n {val_dataset.hdata}\n")
print(f"Test dataset:\n {test_dataset.hdata}\n")

# Save train hyperedge index before adding negatives (for CommonNeighbors)
train_hyperedge_index = train_dataset.hdata.hyperedge_index

# Add negative samples to all splits
for name, ds in [("Train", train_dataset), ("Val", val_dataset), ("Test", test_dataset)]:
num_negative_samples = (
Expand Down
2 changes: 0 additions & 2 deletions examples/hgnnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
print(f"Val dataset:\n {val_dataset.hdata}\n")
print(f"Test dataset:\n {test_dataset.hdata}\n")

train_hyperedge_index = train_dataset.hdata.hyperedge_index

for name, ds in [("Train", train_dataset), ("Val", val_dataset), ("Test", test_dataset)]:
num_negative_samples = (
ds.hdata.num_hyperedges
Expand Down
5 changes: 5 additions & 0 deletions hyperbench/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@

warnings.filterwarnings("ignore", message="Sparse CSR tensor support is in beta state")
warnings.filterwarnings("ignore", message="Sparse invariant checks are implicitly disabled")

warnings.filterwarnings(
"ignore",
message="ignore:Failing to pass a value to the 'type_params' parameter of 'typing._eval_type' is deprecated.*",
)
4 changes: 4 additions & 0 deletions hyperbench/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
ThreadsMathsxDataset,
TwitterDataset,
VegasBarsReviewsDataset,
list_datasets,
get_dataset_by_name,
)

from .loader import DataLoader
Expand Down Expand Up @@ -116,4 +118,6 @@
"VilLainEnricher",
"VilLainHyperedgeAttrsEnricher",
"create_sampler_from_strategy",
"get_dataset_by_name",
"list_datasets",
]
2 changes: 1 addition & 1 deletion hyperbench/data/hif.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def load_by_name(

@classmethod
def __extract_hif(cls, json_file: str) -> HIFHypergraph:
with open(json_file) as f:
with open(json_file, encoding="utf-8") as f:
hiftext = json.load(f)
if not validate_hif_json(json_file):
raise ValueError(f"Dataset from file '{json_file}' is not HIF-compliant.")
Expand Down
Loading
Loading