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

Move CardSampler to separate files and use it in evaluation tests #91

Merged
merged 3 commits into from
Apr 30, 2024

Conversation

azriel1rf
Copy link
Collaborator

This pull request addresses the code duplication of RandomCardSampler between benchmark_plo*.cc and the evaluation_plo*.cc test files.

The changes include:

  • Moving the CardSampler class from benchmark/card_sampler.h to a new header file include/phevaluator/card_sampler.h and source file src/card_sampler.cc
  • Making CardSampler part of the public API by adding it to PUB_HEADERS in CMakeLists.txt
  • Updating the evaluation_plo*.cc test files to use the CardSampler class instead of the local RandomCardSampler function
  • Cleaning up the test files by removing unused includes

Benefits of these changes:

  • Eliminates code duplication of card sampling logic

@azriel1rf azriel1rf linked an issue Apr 29, 2024 that may be closed by this pull request
@azriel1rf azriel1rf requested a review from HenryRLee April 29, 2024 15:45
Copy link
Owner

@HenryRLee HenryRLee left a comment

Choose a reason for hiding this comment

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

Looks good to me!

I didn't intent to move the card_sampler.h to the library include folder as I thought it was only useful for the test code and the benchmark code. Now that I see you've moved it inside a different namespace card_sampler, which looks like a good idea.

Thanks for fixing this old issue!

@HenryRLee HenryRLee merged commit 0f00e78 into develop Apr 30, 2024
6 checks passed
@azriel1rf azriel1rf deleted the card_sampler_as_lib branch April 30, 2024 11:14
azriel1rf added a commit that referenced this pull request Apr 30, 2024
)

* Refactor card_sampler include paths in benchmark files

* Refactor to use `card_sampler::CardSampler` in tests

* Refactor card_sampler implementation to separate header and source files
azriel1rf added a commit that referenced this pull request May 2, 2024
)

* Refactor card_sampler include paths in benchmark files

* Refactor to use `card_sampler::CardSampler` in tests

* Refactor card_sampler implementation to separate header and source files
azriel1rf added a commit that referenced this pull request May 2, 2024
)

* Refactor card_sampler include paths in benchmark files

* Refactor to use `card_sampler::CardSampler` in tests

* Refactor card_sampler implementation to separate header and source files
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.

replace RandomCardSample in evaluation_omaha.cc
2 participants