4da624bfcf
Route building / optimization (tatami_masterplan.py): - fast_total_time was permutation-invariant: it applied get_courses to group *values* instead of slots and ignored the permutation, so every ordering scored identically and the annealing optimized nothing. It now maps each rotation slot to its assigned group via the permutation. - Replaced the broken next_permutation/simulated_annealing (enumerated n! orderings per iteration, fed unnormalized Boltzmann weights to np.random.choice -> ValueError, and returned the last random sample) with a standard neighbor-swap annealer that tracks and returns the best solution and handles <2 slots. - Convert the reduced Timedelta matrix to float seconds before annealing (np.exp can't operate on Timedelta). Group building (tatami_masterplan.py): - assign_courses set each group's hosts (sorted by course) before all courses were assigned, so hosts whose course was still None got mis-ordered. Assign all courses first, then wire up hosts. - get_masterplan no longer mutates the caller's participant list. classes.py: - Narrow casts on distance-matrix lookups to satisfy the mypy gate (pre-existing failures). Tests: - Add pytest suite (74 tests) covering the rotation topology, route cost and optimization, the domain model, the masterplan pipeline, and the Routes API wrapper (HTTP mocked). The cost cross-check caught the assign_courses ordering bug above.
31 lines
613 B
TOML
31 lines
613 B
TOML
[project]
|
|
name = "tatami"
|
|
version = "0.1.0"
|
|
description = "Tool for Arranging Tasty Appointments, Meetings & Invitations"
|
|
readme = "README.md"
|
|
requires-python = ">=3.13"
|
|
dependencies = [
|
|
"numpy>=2.2.4",
|
|
"pandas>=2.2.3",
|
|
"pandas-stubs>=2.2.3.250308",
|
|
"requests>=2.32.3",
|
|
"tqdm>=4.67.1",
|
|
"types-requests>=2.32.0.20250328",
|
|
"types-tqdm>=4.67.0.20250404",
|
|
]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"mypy>=1.15.0",
|
|
"pytest>=9.1.1",
|
|
"ruff>=0.11.5",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
addopts = "-q"
|