Skip to content

fix: address NaN output in weight interpolation - #883

Closed
Chen Yu (michaelawyu) wants to merge 4 commits into
Azure:mainfrom
michaelawyu:fix/weight-interpolation
Closed

Chen Yu (michaelawyu) wants to merge 4 commits into
Azure:mainfrom
michaelawyu:fix/weight-interpolation

Conversation

@michaelawyu

Copy link
Copy Markdown
Contributor

Description of your changes

This PR fixes an issue where weight interpolation will yield a NaN value when a property is of the same value across the fleet.

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

  • Integration tests
  • E2E tests

Special notes for your reviewer

Unit tests for the file have not been checked in before; will submit a separate PR.

return 0, fmt.Errorf("cannot interpolate weight, observed value %v, observed min %v, observed max %v", f, minF, maxF)
}

if minF == maxF {

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.

is there a test case for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi Ryan! I have moved some UTs from another PR to this one for review purposes. The UTs for types.go were not checked in earlier 😣

@michaelawyu

Copy link
Copy Markdown
Contributor Author

Note: the fix itself has been checked in with an earlier PR; closing this one as its content has been included in #887.

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