This PR introduces an entropy.py module that computes the Shannon Entropy, based on the output from (calculate_loc_changes) in git_parser.py.
Within the module, safeguards were used to ensure that probability values cannot be negative. Additionally, a test suite test_entropy.py has been created to validate against negative outputs.
The test datasets were edited to have multiple files in a repository, this is done in the high_entropy repo. To support repositories with multiple files, modifications were made to (calculate_loc_changes) in git_parser.py. It now accepts an additional parameter, file_names: list[str].
The new test repository structure is as follows:
High_Entropy
high_entropy.md
Baseline Content (commit 1)
Added Entropy (commit 2)
high_entropy2.md
Baseline content (commit 1)
Low_Entropy
Low_entropy.md
Baseline content (commit 1)
Added entropy (commit 2)
I appreciate any comments or feedback!
Closes #62 , #64
What is the nature of your change?
[x] Content additions or updates (adds or updates content)
[ ] Bug fix (fixes an issue).
[x] Enhancement (adds functionality).
[ ] Breaking change (these changes would cause existing functionality to not work as expected).
Checklist
Please ensure that all boxes are checked before indicating that this pull request is ready for review.
Description
This PR introduces an
entropy.py
module that computes the Shannon Entropy, based on the output from (calculate_loc_changes
) ingit_parser.py
.Within the module, safeguards were used to ensure that probability values cannot be negative. Additionally, a test suite
test_entropy.py
has been created to validate against negative outputs.The test datasets were edited to have multiple files in a repository, this is done in the
high_entropy
repo. To support repositories with multiple files, modifications were made to (calculate_loc_changes
) ingit_parser.py
. It now accepts an additional parameter,file_names: list[str]
.The new test repository structure is as follows:
High_Entropy
high_entropy.md
high_entropy2.md
Low_Entropy
Low_entropy.md
I appreciate any comments or feedback!
Closes #62 , #64
What is the nature of your change?
Checklist
Please ensure that all boxes are checked before indicating that this pull request is ready for review.