Skip to content

Merge _newton_girard and _newton_girard_matrices (OAK/Sobol) #683

Open

Description

@thomaspinder

Category: simplify · Severity: medium
Location: gpjax/kernels/additive/oak.py:60 · gpjax/kernels/additive/sobol.py:123

Problem

_newton_girard (oak.py:60) and _newton_girard_matrices (sobol.py:123) are the same algorithm — identical power-sum, sign, mask, and fori_loop structure — differing only by trailing broadcast dims of size 1. sobol's own docstring says it is 'the matrix-level analogue of _newton_girard in oak.py'.

Recommendation

Merge into one broadcast-generic implementation and call it from both sites.

Filed from the 2026-07-02 GPJax codebase audit (medium tier). Companion spec for the high-severity items: plans/2026-07-02-audit-high-severity-remediation-design.md.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions