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

Replace operator == for floating-point comparison in test #965

Open
daniel-zullo-frequenz opened this issue Jun 10, 2024 · 1 comment
Open
Labels
part:tests Affects the unit, integration and performance (benchmarks) tests priority:low This should be addressed only if there is nothing else on the table type:enhancement New feature or enhancement visitble to users
Milestone

Comments

@daniel-zullo-frequenz
Copy link
Contributor

daniel-zullo-frequenz commented Jun 10, 2024

What's needed?

Replace operator == in https://github.com/frequenz-floss/frequenz-sdk-python/blob/v1.x.x/tests/actor/test_data_sourcing.py to compare floating-point values against the result of addition operations involving floating-point numbers.

Proposed solution

Use isclose() from pytest or math instead.

Additional context

This is a follow-up from a code review: https://github.com/frequenz-floss/frequenz-sdk-python/pull/955/files#r1630265422

@daniel-zullo-frequenz daniel-zullo-frequenz added part:❓ We need to figure out which part is affected priority:❓ We need to figure out how soon this should be addressed type:enhancement New feature or enhancement visitble to users labels Jun 10, 2024
@daniel-zullo-frequenz daniel-zullo-frequenz added part:tests Affects the unit, integration and performance (benchmarks) tests priority:low This should be addressed only if there is nothing else on the table and removed part:❓ We need to figure out which part is affected priority:❓ We need to figure out how soon this should be addressed labels Jun 10, 2024
@llucax llucax added this to the Untriaged milestone Jun 10, 2024
@llucax
Copy link
Contributor

llucax commented Jun 10, 2024

These tests might need to be changed when upgrading to the microgrid API v0.17, so maybe it can be addressed then.

@shsms shsms modified the milestones: v1.0.0-rc800, v1.0.0-rc900 Aug 22, 2024
@llucax llucax modified the milestones: v1.0.0-rc900, 1.0.0-rc1000 Sep 2, 2024
@llucax llucax modified the milestones: v1.0.0-rc1000, v1.0.0-rc1100 Oct 21, 2024
@llucax llucax modified the milestones: v1.0.0-rc1100, v1.0.0-rc1200 Nov 11, 2024
@llucax llucax modified the milestones: v1.0.0-rc1200, v1.0.0-rc1400 Nov 20, 2024
@llucax llucax modified the milestones: v1.0.0-rc1400, v1.0.0-rc1500 Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:tests Affects the unit, integration and performance (benchmarks) tests priority:low This should be addressed only if there is nothing else on the table type:enhancement New feature or enhancement visitble to users
Projects
Status: To do
Development

No branches or pull requests

3 participants