Skip to content

chore(deps): make scipy an optional dependency#232

Merged
AmitMY merged 1 commit into
masterfrom
chore/remove-scipy-dependency
Jul 3, 2026
Merged

chore(deps): make scipy an optional dependency#232
AmitMY merged 1 commit into
masterfrom
chore/remove-scipy-dependency

Conversation

@AmitMY

@AmitMY AmitMY commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • scipy was a required dependency for just two call sites. PoseNormalizer.rotate used scipy.spatial.transform.Rotation only to build a z-axis rotation matrix — replaced with an explicit cos/sin matrix in pure numpy, verified numerically identical to scipy's output.
  • NumPyPoseBody.interpolate genuinely needs scipy.interpolate.interp1d for quadratic/cubic splines, but it already imports scipy lazily and raises a helpful ImportError — left as-is, so scipy is now needed only if you call interpolate().
  • pyproject.toml: removed scipy from dependencies, added it to the dev extra so tests still cover interpolation.

Test Plan

  • pytest tests pose_format — 176 passed (tf/torch tests skipped locally: frameworks not installed)
  • Numerical check: new numpy rotation matrix matches Rotation.from_euler('z', ...).as_matrix() for arbitrary angles
  • pylint pose_format/utils/normalization_3d.py clean

🤖 Generated with Claude Code

scipy was a required install for just two call sites: a z-axis rotation
matrix in normalization_3d.py (now pure numpy, numerically identical)
and cubic spline interpolation in NumPyPoseBody.interpolate, which
already imports scipy lazily with an install hint. Dropping it from
required dependencies shrinks the install footprint; scipy stays in the
dev extra so tests still cover interpolation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AmitMY AmitMY merged commit bd0359e into master Jul 3, 2026
8 checks passed
@AmitMY AmitMY deleted the chore/remove-scipy-dependency branch July 3, 2026 11:46
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.

1 participant