Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
51 changes: 0 additions & 51 deletions .github/workflows/publish.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Run tests, linting, and type checking
name: CI

on: [push, pull_request]
on:
push:
branches: [main]
pull_request:

jobs:
test:
Expand Down
18 changes: 0 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ __pypackages__/
# Cursor
.cursorrules

# Jupyter Notebooks
.ipynb_checkpoints
.virtual_documents/

# Documentation
# MkDocs
/site

# OS Specific
# macOS
.DS_Store
Expand All @@ -105,7 +97,6 @@ Desktop.ini

# Private content
private/
notebooks/private/
*_private/
*.private.*

Expand All @@ -128,14 +119,6 @@ temp/
temporary/
analysis_temp/
tmp/
analysis*.ipynb
*_analysis.ipynb
analysis*.html
*_analysis.html

# Performance analysis results
dev/perf_results/
dev/perf_plots/

# Repo root file ignores
# Ignore certain file types only at the repository root
Expand All @@ -145,7 +128,6 @@ dev/perf_plots/
/*.json

# Allow required config files
!/mkdocs.yml
!/.pre-commit-config.yaml

# Project directories to ignore at the repository root
Expand Down
25 changes: 0 additions & 25 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,6 @@ repos:
args: [--fix]
- id: ruff-format

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.401
hooks:
- id: pyright
args: [--project, pyproject.toml]
additional_dependencies:
[
"pyyaml",
"pandas",
"matplotlib",
"nbformat",
"nbconvert",
"ipykernel",
"itables",
"rasterio",
"pyproj",
"geopandas",
"shapely",
"scikit-learn",
"networkx",
"contextily",
"pandas-stubs",
"ngraph>=0.23.1",
]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Workflows**: Use `design_analysis_brief` as the default in both Python and YAML configurations.
- **Workflows**: Bind built-in demand references to `traffic.matrix_name`.
- **Failures**: Make the `empty` policy a valid no-failure mode.
- **Docs**: Install from GitHub; the `topogen` name on PyPI belongs to an unrelated project.

### Changed

Expand All @@ -30,12 +31,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Workflows**: Validate `lib/workflows.yml` with NetGraph before emission; steps use `type` and `demand_set`.
- **Workflows**: Use `parallelism: auto` in built-in and sample workflows.
- **Validation**: Construct the full NetGraph scenario to check workflow arguments and failure policies before topology audits.
- **Internal**: Remove redundant validation and scenario code; shorten comments and documentation.
- **Internal**: Remove redundant validation and scenario code, the PyPI publish workflow, the pre-commit Pyright hook and benchmark flags.

### Added

- **Superset**: Add setup, teardown and run commands to install dev dependencies, copy local `.env` files and run checks.

### Removed

- **Dependencies**: Unused `seaborn`, `rich`, `nbformat`, `nbconvert`, `ipykernel`, `itables`, `rasterio` and `scikit-learn` requirements.

## [0.4.0] - 2026-03-15

### Changed
Expand Down
41 changes: 9 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TopoGen development commands

.PHONY: help venv clean-venv dev install check check-ci lint format test qt build clean check-dist publish-test publish validate info hooks check-python
.PHONY: help venv clean-venv dev install check check-ci lint format test qt build clean check-dist validate info hooks check-python

.DEFAULT_GOAL := help

Expand Down Expand Up @@ -33,18 +33,14 @@ help:
@echo " make lint - Run only linting (non-mutating: ruff + pyright)"
@echo " make format - Auto-format code with ruff"
@echo " make validate - Validate YAML configs against schemas"
@echo " make test - Run tests with coverage (includes slow and benchmark)"
@echo " make qt - Run quick tests only (excludes slow and benchmark)"
@echo " make test - Run tests with coverage (includes slow)"
@echo " make qt - Run quick tests only (excludes slow)"
@echo ""
@echo "Build & Package:"
@echo " make build - Build distribution packages"
@echo " make check-dist - Check distribution metadata with twine"
@echo " make clean - Clean build artifacts and cache files"
@echo ""
@echo "Publishing:"
@echo " make check-dist - Check distribution packages with twine"
@echo " make publish-test - Publish to Test PyPI"
@echo " make publish - Publish to PyPI"
@echo ""
@echo "Utilities:"
@echo " make hooks - Run pre-commit on all files"
@echo " make check-python - Check if venv Python matches best available"
Expand Down Expand Up @@ -121,12 +117,12 @@ format:
@$(RUFF) format .

test:
@echo "🧪 Running tests with coverage (includes slow and benchmark)..."
@echo "🧪 Running tests with coverage (includes slow)..."
@$(PYTEST)

qt:
@echo "⚡ Running quick tests only (excludes slow and benchmark)..."
@$(PYTEST) --no-cov -m "not slow and not benchmark"
@echo "⚡ Running quick tests only (excludes slow)..."
@$(PYTEST) --no-cov -m "not slow"

validate:
@echo "📋 Validating TopoGen config YAMLs..."
Expand All @@ -149,42 +145,23 @@ build:
clean:
@echo "🧹 Cleaning build artifacts and cache files..."
@rm -rf build/ dist/ *.egg-info/ || true
@rm -rf .pytest_cache .ruff_cache .mypy_cache htmlcov htmlcov-python .coverage coverage.xml coverage-*.xml .benchmarks .pytest-benchmark || true
@rm -rf .pytest_cache .ruff_cache htmlcov .coverage coverage.xml || true
@find . -path "./venv" -prune -o -type f -name "*.pyc" -delete 2>/dev/null || true
@find . -path "./venv" -prune -o -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
@find . -path "./venv" -prune -o -type f -name "*.pyo" -delete 2>/dev/null || true
@find . -path "./venv" -prune -o -type f -name "*~" -delete 2>/dev/null || true
@find . -path "./venv" -prune -o -type f -name "*.orig" -delete 2>/dev/null || true
@echo "✅ Cleanup complete!"

# Publishing
check-dist:
@echo "🔍 Checking distribution packages..."
@echo "🔍 Checking distribution metadata..."
@if $(PYTHON) -c "import twine" >/dev/null 2>&1; then \
$(PYTHON) -m twine check dist/*; \
else \
echo "❌ twine not installed. Install dev dependencies with: make dev"; \
exit 1; \
fi

publish-test:
@echo "📦 Publishing to Test PyPI..."
@if $(PYTHON) -c "import twine" >/dev/null 2>&1; then \
$(PYTHON) -m twine upload --repository testpypi dist/*; \
else \
echo "❌ twine not installed. Install dev dependencies with: make dev"; \
exit 1; \
fi

publish:
@echo "🚀 Publishing to PyPI..."
@if $(PYTHON) -c "import twine" >/dev/null 2>&1; then \
$(PYTHON) -m twine upload dist/*; \
else \
echo "❌ twine not installed. Install dev dependencies with: make dev"; \
exit 1; \
fi

# Project Information
info:
@echo "📋 TopoGen Project Information"
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ scenarios with site blueprints, hardware, risk groups, traffic, and workflows.
## Install

Requires Python 3.11+. Dependencies include `ngraph>=0.23.1` and
`netgraph-core>=0.10.0`.
`netgraph-core>=0.10.0`. TopoGen is not on PyPI; the `topogen` package there is
an unrelated project.

```bash
pip install topogen
pip install git+https://github.com/networmix/TopoGen
```

For a source checkout:
Expand Down Expand Up @@ -44,8 +45,8 @@ ngraph run output/config_scenario.yml
```

`generate` writes `output/config_integrated_graph.json`, a metro-to-metro corridor
graph. `build` reads it and writes `output/config_scenario.yml`. File prefixes
come from the config filename.
graph, and a preview JPEG. `build` reads the graph and writes
`output/config_scenario.yml`. File prefixes come from the config filename.

`build` checks the schema, NetGraph Scenario construction, topology, and hardware.
`ngraph run` executes the workflows. Add `--print` to `topogen build` to also print
Expand Down
26 changes: 8 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "topogen"
version = "0.4.0"
description = "A network topology generator."
description = "Generate NetGraph backbone scenarios from US Census urban areas and TIGER/Line roads."
readme = "README.md"
authors = [{ name = "Andrey Golovanov" }]
license = "MIT"
Expand All @@ -27,19 +27,11 @@ dependencies = [
"numpy",
"pandas",
"matplotlib",
"seaborn",
"rich",
"nbformat",
"nbconvert",
"ipykernel",
"itables",
# Geographic processing
"rasterio",
"pyproj",
"geopandas",
"shapely",
"scipy",
"scikit-learn",
"networkx",
"contextily",
# Strict schema validation at runtime
Expand All @@ -55,34 +47,33 @@ dev = [
# testing
"pytest>=8",
"pytest-cov",
"pytest-benchmark",
"pytest-mock",
"pytest-timeout",
# json schema validation for scenarios
"jsonschema",
# style + type checking
"ruff==0.11.13",
"pyright==1.1.401",
# type stubs
"pandas-stubs",
# pre-commit hooks
"pre-commit",
# build
# build and metadata checks
"build",
# publishing
"twine",
]

[project.urls]
Repository = "https://github.com/networmix/TopoGen"
Changelog = "https://github.com/networmix/TopoGen/blob/main/CHANGELOG.md"
Issues = "https://github.com/networmix/TopoGen/issues"

[project.scripts]
topogen = "topogen.cli:main"

# Pytest flags
[tool.pytest.ini_options]
addopts = "--cov=./topogen --cov-fail-under=50 --cov-report term-missing --benchmark-disable-gc --benchmark-min-rounds=5 --benchmark-warmup=on"
addopts = "--cov=./topogen --cov-fail-under=50 --cov-report term-missing"
timeout = 30
markers = [
"slow: marks integration tests as slow (deselect with '-m \"not slow\"')",
"benchmark: marks tests as performance benchmarks (run with '-m benchmark')",
]

# Coverage configuration
Expand All @@ -101,7 +92,6 @@ exclude_lines = [
# Package discovery
[tool.setuptools.packages.find]
include = ["topogen*"]
exclude = ["tests*", "notebooks*", "examples*", "dev*"]

[tool.setuptools.package-data]
"topogen.schemas" = ["topogen_config.json"]
Expand Down
Loading