Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the rendering subsystem by splitting the previously monolithic rendering/painter.py into smaller, single-responsibility modules, aligning with issue #56’s separation of concerns (precomputation vs. drawing vs. widgets) while keeping behavior the same.
Changes:
- Introduces
rendering/precompute.pycontaining scene precomputation + slab-clip/polyhedra face collection helpers previously inpainter.py. - Introduces
rendering/axes_widget.pycontaining the crystallographic axes corner widget previously inpainter.py. - Updates renderer call sites and tests to import
_precompute_scene(and related helpers) fromhofmann.rendering.precompute.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/hofmann/rendering/precompute.py |
New module housing view-independent scene precomputation and polyhedra-related helpers. |
src/hofmann/rendering/axes_widget.py |
New module containing the axes-orientation widget drawing routine. |
src/hofmann/rendering/painter.py |
Slimmed to focus on projection/depth sorting and drawing; now imports helpers from the new modules. |
src/hofmann/rendering/interactive.py |
Updated imports to pull _precompute_scene from rendering.precompute. |
src/hofmann/rendering/animation.py |
Updated imports to pull _precompute_scene from rendering.precompute. |
tests/test_rendering/test_painter.py |
Updated imports for moved precompute/polyhedra helpers. |
tests/test_rendering/test_animation.py |
Updated import for moved _precompute_scene. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Splits
rendering/painter.py(1035 lines) into three focused modules (closes #56):precompute.py(389 lines) — scene construction:_PrecomputedScene,_PolyhedronRenderData,_precompute_scene,_apply_slab_clip,_collect_polyhedra_facespainter.py(514 lines) — scene drawing: projection, depth sorting, painter's algorithm,PolyCollectionassemblyaxes_widget.py(172 lines) — crystallographic axes orientation widget (same pattern aslegend.py)Pure move refactor — no logic changes. Also removes a dead
from typing import Anyimport.