Skip to content

Adapt to PolynomialFitFunctionArray.from_degree() in named-arrays#175

Merged
roytsmart merged 2 commits into
mainfrom
fix/polynomial-from-degree
Jun 13, 2026
Merged

Adapt to PolynomialFitFunctionArray.from_degree() in named-arrays#175
roytsmart merged 2 commits into
mainfrom
fix/polynomial-from-degree

Conversation

@jacobdparker

@jacobdparker jacobdparker commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

sun-data/named-arrays#184 replaced the degree parameter of PolynomialFitFunctionArray with coefficient_names + a from_degree() classmethod, which removes the old constructor keyword. This adapts the two consumers in optika:

  • optika.distortion.PolynomialDistortionModel.fit / fit_inverse
  • optika.radiometry.PolynomialVignettingModel.fit

from_degree() is a drop-in for the old constructor pattern, so the models' public degree fields are unchanged. The tests that asserted fit.degree now check fit.coefficient_names.

named-arrays 2.0.0

The breaking change shipped in named-arrays 2.0.0, so the pin is bumped to named-arrays~=2.0. (The release removes the old keyword, which breaks optika main, so this should merge promptly now that 2.0.0 is out.)

Tests

pytest optika/distortion optika/radiometry: 75 passed.

🤖 Generated with Claude Code

named-arrays replaced the degree parameter of PolynomialFitFunctionArray
with coefficient_names and a from_degree() classmethod
(sun-data/named-arrays#184).
Switch the distortion and vignetting models to the classmethod and bump
the named-arrays pin to the first release containing the new API.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jacobdparker jacobdparker force-pushed the fix/polynomial-from-degree branch from d651f5c to 4ee0c24 Compare June 11, 2026 23:35
The PolynomialFitFunctionArray change shipped in named-arrays 2.0.0, not
1.7.0 as originally assumed; update the pin accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.34%. Comparing base (9d38b2c) to head (24c229e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #175   +/-   ##
=======================================
  Coverage   99.34%   99.34%           
=======================================
  Files         116      116           
  Lines        5967     5967           
=======================================
  Hits         5928     5928           
  Misses         39       39           
Flag Coverage Δ
unittests 99.34% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@roytsmart roytsmart marked this pull request as ready for review June 13, 2026 17:13
@roytsmart roytsmart merged commit 6586a31 into main Jun 13, 2026
12 checks 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.

2 participants