Repository navigation
refactor: extract plane_validation module (Candidate 1) - #22
Merged
Merged
Conversation
- Add errors.py (shared UsageError) - Add geometry.py (scalar dist/cross/sub/dot) - Add csv_reader.py (FR-9 tolerant iter_csv_rows) - Add plane_validation.py (Plane, PlaneError, parse_planes, count_planes, predicates) - Update Ex0.py to import from new modules (~200 lines removed) - Update tests to import from new modules - Update README with new module structure and benchmark results - Update benchmarks/results-2026-11-07.md (3-repeats, 30 cases) All 123 tests pass; mypy clean; NFR-1 hard bar met (50.1 FPS on croissant^2).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts the plane parsing + validation logic from
Ex0.pyinto a dedicatedplane_validationmodule with a clean, deep interface. This is Candidate 1 from the architecture review (Strong recommendation).Changes
New Modules
errors.pyUsageErrorexception (FR-2)geometry.py_dist,_cross,_sub,_dot)csv_reader.pyiter_csv_rows(path)— FR-9 tolerant CSV iterationplane_validation.pyPlane,PlaneError,parse_planes,count_planes, predicatesUpdated Files
Ex0.py— ImportsPlane,PlaneError,parse_planes,count_planes,UsageErrorfrom new modules (~200 lines removed)tests/test_plane_validation.py— Imports fromplane_validationtests/test_plane_list.py— Imports fromplane_validationanderrorstests/test_cli.py— ImportsPlane,PlaneError,parse_planesfromplane_validationtests/test_renderer.py— ImportsPlane,PlaneError,parse_planesfromplane_validationREADME.md— Updated module structure and benchmark resultsbenchmarks/results-2026-11-07.md— New 3-repeats cross-product resultsArchitecture Improvement
Before: Single
Ex0.pywith all validation logic inline (~200 lines for parsing + predicates)After: Deep
plane_validationmodule with one small interface:Benefits Achieved
parse_planesthrough a clean importplane_validationdirectly; predicates exercised via real code pathVerification
croissant.nrrd × croissant.csv(500³ uint8, canonical case)python Ex0.py file.nrrd file.csv file.mp4AI Disclosure: This PR was developed with AI assistance (Nemotron 3 Ultra via OpenCode). All architectural decisions were made through a structured grilling loop; code was reviewed and tested before commit.