Skip to content

Add Procrustes scale centered function with test cases - #73

Merged
kellrott merged 1 commit into
ohsu-comp-bio:developfrom
kbcoulter:centered
Sep 15, 2026
Merged

kellrott merged 1 commit into
ohsu-comp-bio:developfrom
kbcoulter:centered

Conversation

@kbcoulter

Copy link
Copy Markdown
Contributor

Added procrustes function with centering and scaling

The function procrustes_scale_centered computes the same rotation as procrustes_scale, but centers beforehand, following the standard orthogonal procrustes approach.

Changes

align.py: New procrustes_scale_centered() function, taking identical args to procrustes_scale()

test_align.py: Generated tests for the new centered procrustes and added potentially missing tests for the uncentered approach.

  • procrustes_scale_centered mean-centering correctness
  • procrustes_scale_centered rotation+scale+translation recovery
  • procrustes_scale identity case
  • procrustes_scale rotation+scale recovery

…o procrustes_scale, but centers before rotation. Test cases added for both centered and uncentered

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved issues were identified.

Pull request overview

Adds centered Procrustes scaling with rotation, scaling, and translation support.

Changes:

  • Added procrustes_scale_centered.
  • Added tests for centered and uncentered transformations.
File summaries
File Description
tests/preprocessing/test_align.py Tests centering, identity, scaling, rotation, and transformation recovery.
src/embkit/align.py Implements centered Procrustes scaling.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@kellrott
kellrott merged commit 9058cfc into ohsu-comp-bio:develop Sep 15, 2026
1 check passed
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.

3 participants