Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid NaN values in WeightedSnapshot #1233

Merged
merged 1 commit into from Dec 19, 2017

Conversation

@arteam
Copy link
Member

commented Dec 19, 2017

Theoretically, we could have a snapshot with the values which have zero weights. In this case a normalized weight will have a NaN value, because 0/0 = NaN. We should avoid it and in case a weight is zero, make the normalized weight zero too.

See #1230 and #1173

Avoid NaN values in WeightedSnapshot
Theoretically, we could have a snapshot with the values which have
zero weights. In this case a normalized weight will have a NaN value,
because 0/0 = NaN. We should avoid it and in case a weight is zero,
make the normalized weight zero too.

@arteam arteam merged commit 6d44afd into 4.0-development Dec 19, 2017

3 checks passed

codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@arteam arteam deleted the add_weighted_snapshot_nan_check branch Dec 19, 2017

@arteam arteam added this to the 3.2.6 milestone Dec 19, 2017

@arteam arteam added the bug label Dec 19, 2017

arteam added a commit that referenced this pull request Dec 19, 2017
Avoid NaN values in WeightedSnapshot (#1233)
Theoretically, we could have a snapshot with the values which have
zero weights. In this case a normalized weight will have a NaN value,
because 0/0 = NaN. We should avoid it and in case a weight is zero,
make the normalized weight zero too.
arteam added a commit that referenced this pull request Dec 21, 2017
Avoid NaN values in WeightedSnapshot (#1233)
Theoretically, we could have a snapshot with the values which have
zero weights. In this case a normalized weight will have a NaN value,
because 0/0 = NaN. We should avoid it and in case a weight is zero,
make the normalized weight zero too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.