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

add test help fn #273

Merged
merged 6 commits into from
Jan 18, 2025
Merged

add test help fn #273

merged 6 commits into from
Jan 18, 2025

Conversation

asukaminato0721
Copy link
Collaborator

This pull request includes changes to improve the test code and simplify data handling. The changes focus on replacing vec![] with array literals, introducing a helper function for approximate equality assertions, and simplifying the construction of FSRSReview instances.

Improvements to test code:

  • src/cosine_annealing.rs: Replaced vec![] with array literals and used the new assert_approx_eq helper function for asserting approximate equality in tests. [1] [2] [3]
  • src/inference.rs: Removed the local assert_approx_eq function and replaced it with the newly introduced helper function from test_helpers.rs. [1] [2]
  • src/training.rs: Replaced vec![] with array literals and used the new assert_approx_eq helper function for asserting approximate equality in tests. [1] [2] [3] [4]

Simplification of data handling:

Introduction of helper functions:

  • src/test_helpers.rs: Added a new assert_approx_eq helper function to assert approximate equality of arrays in tests.

@asukaminato0721 asukaminato0721 marked this pull request as draft January 18, 2025 06:12
@asukaminato0721 asukaminato0721 marked this pull request as ready for review January 18, 2025 07:32
Copy link
Member

@L-M-Sherlock L-M-Sherlock left a comment

Choose a reason for hiding this comment

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

Great! The code is much more clear now!

@L-M-Sherlock L-M-Sherlock merged commit 735d51a into main Jan 18, 2025
3 checks passed
@L-M-Sherlock L-M-Sherlock deleted the approx_eq_fn branch January 18, 2025 08:32
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