Add Initial Unit Tests for PCGA #2
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This Pull Request introduces the first set of unit tests for the Proportions Controlling Genetic Algorithm (PCGA). Issue-1 The new tests are designed to ensure the correctness and reliability of key functionalities within the algorithm. This initial test suite focuses on the basic functionality of helper methods and core components of the PCGA class.
Changes
test_helper_functions.py:test_count_to_proportionsto validate the conversion from counts to proportions.test_proportions_controlling_ga.py:test_pcga_initializationto ensure theProportionsControllingGAclass initializes correctly with the provided parameters.test_calculate_fitness_valueto test the fitness value calculation logic within theProportionsControllingGAclass.Impact
Testing
The tests were executed using

pytest, and all tests passed successfully.These tests are a starting point, and additional tests will be added in the future to cover more aspects of the algorithm.
How to Test
pytestif it's not already installed:pip install pytest.pytestin the terminal from the root directory of the project.