fix: decouple chapter 4 mesh shape from image resolution - #59
Merged
Conversation
tutorial_3_inversions built its pixelization mesh with shape=dataset.shape_native, tying mesh size to image resolution: 10000 mesh pixels at full resolution but only 256 under PYAUTO_SMALL_DATASETS, which every automated run sets. The tutorial's pix_indexes of [[445], [285], [313], [132], [11]] then index past the end -> IndexError. The indices are not at fault. They match the 625-pixel mesh of HowToLens/scripts/chapter_4_pixelizations/tutorial_3_inversions.py:102 (shape=(25, 25)) that they were copied from, and this file's own line 176 already uses shape=(25, 25). Line 82 was the anomaly. This was previously masked: before #57 the script died earlier on 'plot_array() got an unexpected keyword argument mask', so the IndexError was unreachable. PyAutoHands' notebook runner resolves the same config/build/profile_smoke.yaml, so without this change PyAutoHeart's next weekly run would fail this notebook with IndexError instead of TypeError and stay red. Verified: all five chapter_4_pixelizations tutorials green under the CI smoke profile, and tutorial_3 is 19x faster there (8.2s vs 156.7s). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
Decouples the chapter 4 pixelization mesh from image resolution.
scripts/chapter_4_pixelizations/tutorial_3_inversions.py:82built the mesh withshape=dataset.shape_native, tying mesh size to the image: 10000 mesh pixels at full resolution, but only 256 underPYAUTO_SMALL_DATASETS, which every automated run sets. The tutorial'spix_indexes = [[445], [285], [313], [132], [11]](line 140) then index past the end:The indices are not at fault. They match the 625-pixel mesh of
HowToLens/scripts/chapter_4_pixelizations/tutorial_3_inversions.py:102(shape=(25, 25)) that they were copied from — and this file's own line 176 already usesshape=(25, 25). Line 82 was the anomaly.dataset.shape_native→ 100×100PYAUTO_SMALL_DATASETS=1dataset.shape_native→ 16×16(25, 25)Why this is urgent, and separate from #58
This was masked until now: before #57 the script died earlier on
plot_array() got an unexpected keyword argument 'mask', so theIndexErrorwas unreachable.PyAutoHands' notebook runner resolves the same
config/build/profile_smoke.yaml(run.py→find_profile), so without this change PyAutoHeart's next weekly run fails this notebook withIndexErrorinstead ofTypeErrorand stays red. #57 fixed the reported error; this finishes the job.It is deliberately split from #58 (the smoke-coverage rework) so a one-line unblock does not wait on review of a three-repo CI change.
Scripts Changed
scripts/chapter_4_pixelizations/tutorial_3_inversions.py—shape=dataset.shape_native→shape=(25, 25)notebooks/chapter_4_pixelizations/tutorial_3_inversions.ipynb— regenerated via PyAutoHands (not hand-edited)Test Plan
chapter_4_pixelizationstutorials green under the exact CI smoke profile (the one Heart uses), from a deleteddataset/so nothing stale was inheritedtutorial_3is 19× faster under that profile: 8.2s vs 156.7sGenerated by the PyAutoLabs agent workflow.