Skip to content

test(viz): quantity/modeling_visualization_jit.py — JIT-cached integration script #56

@Jammy2211

Description

@Jammy2211

Overview

Author the missing quantity/modeling_visualization_jit.py JIT-cached integration script in autogalaxy_workspace_test. The repo currently has quantity/visualization_jax.py (single-shot, no Nautilus) but lacks the JIT-cached + live-Nautilus variant that exists for every other dataset type. Mirrors the structure of the imaging variant shipped in PR #54.

Phase D.2.b.i of z_features/fast_visualization.md. Phase D.2.b.ii (ellipse) and D.2.b.iii (weak lensing) are separate follow-ups; this PR is scoped to one new file in one repo so the pattern can be validated before authoring the more divergent dataset types.

Plan

  • New file autogalaxy_workspace_test/scripts/quantity/modeling_visualization_jit.py mirroring the structure of autogalaxy_workspace_test/scripts/imaging/modeling_visualization_jit.py (Part-1 caching probe + non-lensing __Visualization Sanity__ block + Part-2 live Nautilus quick-update).
  • Dataset / mask / model_mge reused from quantity/visualization_jax.py. Swap ag.AnalysisImagingag.AnalysisQuantity; everything else stays the same shape.
  • Non-lensing Sanity template from Phase D.1: fit.model_data finite + non-zero, fit.figure_of_merit finite (confirmed FitQuantity.model_data API at autogalaxy/quantity/fit_quantity.py:71-72).
  • No library changes, no edits to existing visualization_jax.py, no new dataset coverage outside quantity.
Detailed implementation plan

Affected Repositories

  • autogalaxy_workspace_test (primary)

Work Classification

Workspace.

Branch Survey

Repository Current Branch Dirty?
./autogalaxy_workspace_test main pre-existing drift (dataset/*/jax_test/galaxies.json), unrelated

Suggested branch: feature/quantity-modeling-viz-jit
Worktree root: ~/Code/PyAutoLabs-wt/quantity-modeling-viz-jit/ (created later by /start_workspace)

Implementation Steps

  1. Read template autogalaxy_workspace_test/scripts/imaging/modeling_visualization_jit.py — that's the Part-1 / Sanity / Part-2 skeleton.
  2. Read source for dataset/model autogalaxy_workspace_test/scripts/quantity/visualization_jax.py — copy the dataset path, mask construction, and model_mge composition. Swap ag.AnalysisImagingag.AnalysisQuantity (existing in viz_jax already — no API change needed).
  3. Author autogalaxy_workspace_test/scripts/quantity/modeling_visualization_jit.py:
    • Module docstring matching the imaging variant's, retargeted for quantity.
    • Part 1: same caching-probe shape, asserting cached_time < compile_time * 0.5 and analysis_mge._jitted_fit_from is not None.
    • __Visualization Sanity__ block: non-lensing template from PR test(viz): __Visualization Sanity__ rollout across modeling_visualization_jit*.py #54fit_2.model_data finite/non-zero, fit_2.figure_of_merit finite.
    • Part 2: live Nautilus quick-update on a small model_mge with iterations_per_quick_update, assert fit.png lands in the configured output path.
  4. Local validationpython scripts/quantity/modeling_visualization_jit.py (no PYAUTO_TEST_MODE). Confirm Part 1 + Sanity + Part 2 pass end-to-end and the printed |model_data|.sum() / FoM are sensible.

Key Files

  • autogalaxy_workspace_test/scripts/quantity/modeling_visualization_jit.py — new file (1 script).

Out of scope (Phase D.2.b.ii / D.2.b.iii)

  • autogalaxy_workspace_test/scripts/ellipse/modeling_visualization_jit.py + visualization_jax.py (both missing — D.2.b.ii).
  • autolens_workspace_test/scripts/weak/ (entire directory missing — D.2.b.iii).
  • Any library code change.

Original Prompt

Click to expand starting prompt

See PyAutoPrompt/issued/quantity_modeling_visualization_jit.md for the verbatim authored prompt. Key reference points kept inline:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions