Adapt to PolynomialFitFunctionArray.from_degree() in named-arrays#175
Merged
Conversation
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>
d651f5c to
4ee0c24
Compare
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sun-data/named-arrays#184 replaced the
degreeparameter ofPolynomialFitFunctionArraywithcoefficient_names+ afrom_degree()classmethod, which removes the old constructor keyword. This adapts the two consumers in optika:optika.distortion.PolynomialDistortionModel.fit/fit_inverseoptika.radiometry.PolynomialVignettingModel.fitfrom_degree()is a drop-in for the old constructor pattern, so the models' publicdegreefields are unchanged. The tests that assertedfit.degreenow checkfit.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 optikamain, so this should merge promptly now that 2.0.0 is out.)Tests
pytest optika/distortion optika/radiometry: 75 passed.🤖 Generated with Claude Code