Repository navigation
feat: cluster/multi-source point figures — unified dataset, global fit, fit_per_image, with_points, per-redshift curves - #794
Merged
Conversation
Unified Dataset Positions / Fit Positions figures for one or many point sources, the new fit_per_image.png (residual ranking / IP / SP rows), multi- source image_with_points / fit_image_with_points, each source's critical curves at its own redshift from the full tracer (fast deflection-field contouring), darker/thicker curves and caustics, -2 ln L for the all-pairs mixture, and combined (factor-graph) visualization with plots.yaml toggles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Y6tDwGThyc8UowuncXw88
Collaborator
Author
|
Modelling-run verification (PYAUTO_TEST_MODE=1 Nautilus, library default plots.yaml, worktree libraries):
|
…e_with_points Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Y6tDwGThyc8UowuncXw88
This was referenced Oct 21, 2026
Merged
This was referenced Oct 22, 2026
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
Cluster-scale (multi-source) point-source figures, ported from the v4 prototypes the human approved on 2026-10-21 (closes #793). Every positions figure now uses one visual language for one or many sources, each source's critical curves are drawn at its OWN redshift (absorbing the "point fit critical curves ignore source redshift" bug), and every figure is configured in
plots.yamland written during a realsearch.fit, including the all-sources figures of a factor-graph (cluster) fit.dataset_point.png"Dataset Positions": source 0 a black dot, further sources colour + marker shape (colour by redshift with a colourbar beyond 8 sources); images labelledi/k·i; no curves.fit.png"Fit Positions": red ✕ at the true model positions, true-length residual lines (solid hard / dashed soft pairing), no exaggerated arrows; per-source own-redshift curves, darker and thicker; σ on the per-source legend entries (2-8 sources); smaller ✕ beyond 8; solver extent;−2 ln L = …instead ofχ² = …forFitPositionsImagePairAll; legend in the emptiest corner (single source) or outside the panel (several). The source-plane panel moves tofit_per_image.png.fit_per_image.png(new): one row per source, "Residuals / IP / SP (point_k, z = …)"; square equal panels, library ticks/fonts, no legends; ranking with σ values printed right of the dots, no x axis, unlabelled 1σ/3σ lines, a linear range shared across sources (robust max, off-scale ▸ values); per-image colours shared across the three panels. Source-plane fits rank by the fit's own per-image χ. Beyond 8 sources:fit_per_image/<name>.png.image_with_points.png/fit_image_with_points.png: every source in the same symbols (white-edged),k·ilabels, no legend; the fit version draws each source's tangential curves at its own redshift.point_sources.curves_for_planesevaluates the FULL tracer's deflection field once on a 400×400 grid, differentiates it and contours λt = 0 / λr = 0 (one field for every plane when the mass is in one lens plane). The visualizer uses it for every point figure and the tracer figures, replacing the ~2 min/datasetLensCalcpath on the 15-galaxy cluster.API Changes
New modules
autolens.point.plot.point_sources(per-source records, styles, per-plane curves, ranking scales) andautolens.point.plot.multi_source_plots(the five figures for any number of sources).subplot_fit,subplot_datasetandplot_image_with_pointskeep their signatures (new optionalcurves/solverkwargs) and delegate to the unified figures;fit.pngno longer contains the source-plane panel.PlotterPointgainsfit_per_image,dataset_point_combined,fit_point_combined,image_with_points_combined;VisualizerPointgainsvisualize_combined/visualize_before_fit_combined. Newplots.yamlkeys (all default on):point_dataset: subplot_dataset_combined, image_with_points_combined;fit_point_dataset: fit_per_image, subplot_fit_combined, fit_per_image_combined, fit_image_with_points_combined.See full details below.
Test Plan
test_autolens(full): 925 passed, 1 xfailed (incl. 14 new tests intest_autolens/point/plot/test_multi_source_plots.py: per-plane curves vsLensCalcon a 3-plane lens, styles, legends absent / σ labels /−2 ln L, shared vs lone ranking range, per-source files beyond 8, combined visualizer writes, config toggle)search.fit(PYAUTO_TEST_MODE=1, library defaultplots.yaml) on the point_source dataset:dataset_point.png,image_with_points.png,fit.png,fit_per_image.png,fit_image_with_points.pngwrittensearch.fit(2-source cluster,AnalysisFactor×2): per-analysis figures underanalyses/analysis_<i>/image/and the all-sources figures in the top-levelimage/(see comment)Full API Changes (for automation & release notes)
Added
autolens.point.plot.point_sources:SourceRecord,source_record_from_dataset,source_record_from_fit,assign_styles,PlaneCurves,curves_for_planes(tracer, plane_indexes, extent, shape=400),curves_for_records,curves_for_fits,magnifications_at,union_extent_from,ranking_scales_from,RankingScalesautolens.point.plot.multi_source_plots:plot_dataset_positions(datasets, solver=None, ...),plot_fit_positions(fits, solver=None, curves=None, ...),subplot_fit_per_image(fits, curves=None, solver=None, ...),plot_image_with_points(image, datasets=None, fits=None, curves=None, ...)and thedraw_*panel helpersPlotterPoint.fit_per_image,.dataset_point_combined,.fit_point_combined,.image_with_points_combinedVisualizerPoint.visualize_combined,.visualize_before_fit_combinedplot_source_plane_panel(..., point_colors=None, legend=True);plot_mass_centres(ax, tracer, size=140, linewidths=2)plots.yamlkeys listed aboveChanged
fit.png: one "Fit Positions" panel (+ "Fit Fluxes" when fluxes); the source-plane panel is infit_per_image.png0.2/#5c5c00, linewidth 1.8 (CRITICAL_CURVE_COLOR_MAP,CAUSTIC_COLOR)image_with_pointsfigures: no legend, numbered images, title "Image With Points (point_0)"Migration
config/visualize/plots.yamlfiles should add the new keys (missing keys fall back to on).Generated by the PyAutoLabs agent workflow.
Heart: YELLOW (pre-existing, human-acknowledged): manifest drift: workspace checkouts — 1 mismatch vs PyAutoMind/repos.yaml; release validation stale: source moved since rehearsal (PyAutoArray).
🤖 Generated with Claude Code
https://claude.ai/code/session_019Y6tDwGThyc8UowuncXw88