Skip to content

perf: cache galaxy_model_image_dict and model_images_of_planes_list#424

Merged
Jammy2211 merged 1 commit intomainfrom
feature/cache-fit-imaging-properties
Apr 7, 2026
Merged

perf: cache galaxy_model_image_dict and model_images_of_planes_list#424
Jammy2211 merged 1 commit intomainfrom
feature/cache-fit-imaging-properties

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Change galaxy_model_image_dict and model_images_of_planes_list from @property to @cached_property on FitImaging. These were being recomputed 4 times per subplot_fit_imaging call (by _get_source_vmax, lens plane panel, source plane panel, and subtracted_images_of_planes_list), each triggering the full ray-tracing chain.

API Changes

None — cached_property is already imported from autoconf. Callers see no difference.

Test Plan

  • All 245 PyAutoLens tests pass
  • subplot_fit_imaging: 3.9s → 1.9s (before other optimizations)

🤖 Generated with Claude Code

Change from @Property to @cached_property to avoid recomputing the
full ray-tracing chain 4 times per subplot_fit_imaging call. The
subplot accesses these via _get_source_vmax, per-plane panels, and
subtracted_images_of_planes_list — now all share the single cached
result.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 821ba67 into main Apr 7, 2026
2 checks passed
@Jammy2211 Jammy2211 deleted the feature/cache-fit-imaging-properties branch April 7, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant