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

Fix precision problem in metric's testcases #185

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

MooooCat
Copy link
Contributor

@MooooCat MooooCat commented Jun 5, 2024

Description

The changes in this PR aim to address the issue of Python's floating-point precision causing test failures. This PR sets an absolute tolerance of 1e-9 using the np.isclose function.

Motivation and Context

The original test cases were failing due to Python's floating-point precision issues. This was causing the test cases to fail even though the results were theoretically correct.

By introducing absolute tolerances, we can make the test cases more robust and less likely to fail due to floating-point precision issues.

How has this been tested?

The changes have been tested using testing cases.

Types of changes

  • Maintenance (no change in code, maintain the project's CI, docs, etc.)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@MooooCat MooooCat requested review from sjh120 and Z712023 June 5, 2024 10:17
Copy link
Collaborator

@Z712023 Z712023 left a comment

Choose a reason for hiding this comment

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

It is nice to see np.close() here

@MooooCat MooooCat merged commit d60da3f into main Jun 6, 2024
12 checks passed
@MooooCat MooooCat deleted the bugfix-fix-MISim-testcase branch June 6, 2024 23:27
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