Skip to content

fix: Restore SersicCoreSph mass-to-light ratio #660

Closed

Description

@Jammy2211

Overview

Restore SersicCoreSph mass-to-light ratio. Part of the four related mass-profile fixes requested on 2026-10-25. Each remains an independent task and PR.

Plan

  • Append mass_to_light_ratio=1.0 to the spherical constructor and forward it to the parent; restore its prior matching the elliptical class. Test deflection and convergence scaling and model construction.
  • Run focused regressions and the full PyAutoGalaxy NumPy suite; put JAX validation in workspace parity scripts.
  • Preserve separate branch claims and report test evidence and limitations.

Tier: glance — merge mode: human /prm (no automatic merge requested).

Detailed implementation plan

Primary repository: PyAutoGalaxy. Branch: feature/sersic-core-sph-ml. Clean checkout from origin/main; open PR #656 was inspected and is unrelated. Workspace parity changes, where needed, belong to autogalaxy_workspace_test / autolens_workspace_test. Implement in the profile module named by the prompt and its matching tests. No API removals; the SersicCoreSph keyword is appended to preserve positional callers. Heart readiness GREEN at launch. Execute the four independent branches sequentially as this user-requested group.

Original Prompt

Starting prompt

SersicCoreSph has no mass_to_light_ratio argument

Type: bug
Target: PyAutoGalaxy
Repos:

  • PyAutoGalaxy
    Difficulty: small
    Autonomy: safe
    Priority: medium
    Status: formalised
    Consequence: glance
    Witness: Either SersicCoreSph.__init__ accepts mass_to_light_ratio, the sersic_core.yaml prior block is restored and a test shows its deflections scale linearly with it, or the class docstring states it is intensity-scaled by design and the config-priors walker test stays green.
    Review-minutes: 3
    Unattended: ready

SersicCoreSph stellar mass profile has no mass_to_light_ratio argument. Found by the config-priors-drift walker test (PyAutoGalaxy#618 / PR #619): autogalaxy/config/priors/mass/stellar/sersic_core.yaml carried a SersicCoreSph.mass_to_light_ratio prior block that was silently dead because SersicCoreSph.__init__ only accepts alpha, centre, effective_radius, gamma, intensity, radius_break, sersic_index. Its elliptical sibling SersicCore in the same module does take mass_to_light_ratio. Decide whether the spherical stellar profile is missing the argument (bug: the mass profile cannot be scaled by M/L) or whether the class is deliberately intensity-scaled, and either add the argument + restore the prior block or document why not. The dead prior block was removed in PR #619; restore it if the argument is added.

Activity

  1. Jammy2211 commented on Oct 25, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped via PyAutoGalaxy#664, confirmed merged after Python 3.12/3.13, no-JAX and docs jobs passed. Local full suite: 1360 passed, 6 skipped; downstream PyAutoLens Tracer smoke passed. Library change awaits the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions