-
-
Notifications
You must be signed in to change notification settings - Fork 46.1k
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
feat: Introduce hamming code generator #11827
base: master
Are you sure you want to change the base?
Conversation
Introduced a new .py file which generates 16 bit hamming codes from the given 11 bit input. Additional 5 bits are redundant, used to correct single bit errors within the data bits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
for more information, see https://pre-commit.ci
changed name of x, y to temp_bit1, temp_bit2 respectively
github.com:AyushChakraborty/TheAlgorithms into branch1
for more information, see https://pre-commit.ci
will change the names of x, y to temp_bit1, temp_bit2 |
Changed the code according the feedback given by failed PR (TheAlgorithms#11827)
for more information, see https://pre-commit.ci
made the lines in the docstring shorter, imported modules according to the specified norm and added k values to a list and used membership operation instead of checking the values of k individually in one of the if statements |
changed code based on suggestion by @jeffreyyancey, fixed up some docstring, links and wrote code for finding redundant bits using for loops instead of reduce and lambda, for readability
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@jeffreyyancey added the appropriate changes |
The only concern I have left is that it doesn't appear your are enforcing that the |
Oh yes, I completely overlooked this, thanks I'll make the changes. |
for more information, see https://pre-commit.ci
Updated the code, can you, if possible merge the PR now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks like it is working well, just a couple minor things and I'd be happy to approve.
Primarily, can you remove r
since it is no longer used in this implementation, and can you update the couple variable that need more descriptive names.
github.com:AyushChakraborty/TheAlgorithms into branch1
for more information, see https://pre-commit.ci
github.com:AyushChakraborty/TheAlgorithms into branch1
@jeffreyyancey implemented the pop method |
There was a problem hiding this 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.
@jeffreyyancey this is actually my first open source contribution, so do you have any idea how the PR can be accepeted into the main repo? |
I believe that one of the admins needs to give their approval. Approvals from other users will not allow merging. Instead, it helps find any issues prior to one of the individuals with the rights to approve for merging to view. |
Ok got it, thanks for the help |
Introduced a new .py file which generates 16 bit
hamming codes from the given 11 bit input.
Additional 5 bits are redundant, used to correct
single bit errors within the data bits
Describe your change:
Introduced a new .py file called hamming_code_generator.py which generates 16 bit hamming codes. 5 bits introduced are for redundancy and used to check and correct for a single bit change anywhere in the final 16 bit binary number. Doctests are written and all other rules mentioned in the checklist and README.md file are followed by me.
Checklist: