Skip to content

refactor: build lens_dict directly and keep source separate in group scripts#58

Merged
Jammy2211 merged 1 commit into
releasefrom
feature/group-dict-api
Apr 13, 2026
Merged

refactor: build lens_dict directly and keep source separate in group scripts#58
Jammy2211 merged 1 commit into
releasefrom
feature/group-dict-api

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Refactor the group model composition API to (1) build lens_dict directly in the loop instead of building a list and converting with a comprehension, and (2) keep the source galaxy separate from lens_dict, passing it as source=source in the af.Collection() call. This makes the API clearer for users and more consistent with the imaging scripts.

Scripts Changed

  • scripts/group/start_here.py — replaced lens_models=[]/append/comprehension with direct lens_dict={} building; moved source out of lens_dict into af.Collection(**lens_dict, source=source)
  • scripts/group/modeling.py — same refactor in both simple Sersic and MGE model composition blocks
  • scripts/group/slam.py — converted lens_light_models and lens_full_models lists to direct lens_dict building in source_lp_0 and source_lp_1; moved lens_dict["source"] into af.Collection() calls across all 6 SLaM stages

Test Plan

  • Smoke test start_here.py — model composes and fits successfully
  • Smoke test modeling.py — model composes and fits successfully
  • slam.py syntax verification passes

Closes #56

🤖 Generated with Claude Code

…scripts

Replace list-then-convert pattern (lens_models=[]/append/comprehension)
with building lens_dict={} directly in the loop. Keep source galaxy
separate from lens_dict, passing it as a keyword in af.Collection().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

refactor: build lens_dict directly and keep source separate in group scripts

1 participant