Skip to content

Conversation

@nirbhay12345
Copy link

@nirbhay12345 nirbhay12345 commented Jan 16, 2022

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #4977.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.

@ghost ghost added require descriptive names This PR needs descriptive function and/or variable names require tests Tests [doctest/unittest/pytest] are required require type hints https://docs.python.org/3/library/typing.html labels Jan 16, 2022
Copy link

@ghost ghost left a 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.

ciphers/a51.py Outdated
tapped_bits_2:list = [20,21]
tapped_bits_3:list = [7,20,21,22]

def set_register(type:int, i:int, a:str):
Copy link

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file ciphers/a51.py, please provide doctest for the function set_register

Please provide return type hint for the function: set_register. If the function does not return a value, please provide the type hint as: def function() -> None:

Please provide descriptive name for the parameter: i

Please provide descriptive name for the parameter: a

ciphers/a51.py Outdated
if i < 23:
LFSR3[i] = intermediate_xor ^ int(a)

def majority(arr:list):
Copy link

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file ciphers/a51.py, please provide doctest for the function majority

Please provide return type hint for the function: majority. If the function does not return a value, please provide the type hint as: def function() -> None:

ciphers/a51.py Outdated
if(val > 1):
return key

def set_register_majority(mv:int):
Copy link

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file ciphers/a51.py, please provide doctest for the function set_register_majority

Please provide return type hint for the function: set_register_majority. If the function does not return a value, please provide the type hint as: def function() -> None:

ciphers/a51.py Outdated
LFSR3.insert(0, intermediate_xor)
LFSR3.pop()

def main():
Copy link

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file ciphers/a51.py, please provide doctest for the function main

Please provide return type hint for the function: main. If the function does not return a value, please provide the type hint as: def function() -> None:

@ghost ghost added the awaiting reviews This PR is ready to be reviewed label Jan 16, 2022
@ghost ghost removed the require type hints https://docs.python.org/3/library/typing.html label Jan 16, 2022
Copy link

@ghost ghost left a 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.

ciphers/a51.py Outdated
tapped_bits_2:list = [20,21]
tapped_bits_3:list = [7,20,21,22]

def set_register(type:int, i:int, a:str) -> None:
Copy link

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file ciphers/a51.py, please provide doctest for the function set_register

Please provide descriptive name for the parameter: i

Please provide descriptive name for the parameter: a

ciphers/a51.py Outdated
if i < 23:
LFSR3[i] = intermediate_xor ^ int(a)

def majority(arr:list) -> None:
Copy link

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file ciphers/a51.py, please provide doctest for the function majority

ciphers/a51.py Outdated
if(val > 1):
return key

def set_register_majority(mv:int) -> None:
Copy link

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file ciphers/a51.py, please provide doctest for the function set_register_majority

LFSR3.insert(0, intermediate_xor)
LFSR3.pop()

def main() -> None:
Copy link

Choose a reason for hiding this comment

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

As there is no test file in this pull request nor any test function or class in the file ciphers/a51.py, please provide doctest for the function main

Copy link
Member

Choose a reason for hiding this comment

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

We need more doctests

@ghost ghost removed the require tests Tests [doctest/unittest/pytest] are required label Jan 16, 2022
Copy link

@ghost ghost left a 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.

ciphers/a51.py Outdated
tapped_bits_2:list = [20,21]
tapped_bits_3:list = [7,20,21,22]

def set_register(type:int, i:int, a:str) -> None:
Copy link

Choose a reason for hiding this comment

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

Please provide descriptive name for the parameter: i

Please provide descriptive name for the parameter: a

@ghost ghost removed the require descriptive names This PR needs descriptive function and/or variable names label Jan 16, 2022
@nirbhay12345
Copy link
Author

@poyea please review this PR

@poyea poyea self-assigned this Jan 21, 2022
"""
>>> set_register_majority(0)
"""
if (majority_value == LFSR1[8]):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (majority_value == LFSR1[8]):
if majority_value == LFSR1[8]:

Comment on lines +13 to +19
for _ in range(reg1_len):
LFSR1.append(0)
for _ in range(reg2_len):
LFSR2.append(0)
for _ in range(reg3_len):
LFSR3.append(0)

Copy link
Member

Choose a reason for hiding this comment

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

Use [0] * N?

Copy link
Author

Choose a reason for hiding this comment

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

okay working on this

@ghost ghost added the tests are failing Do not merge until tests pass label Jan 21, 2022
@stale
Copy link

stale bot commented Apr 18, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Used to mark an issue or pull request stale. label Apr 18, 2022
@cclauss
Copy link
Member

cclauss commented Oct 1, 2022

In preparation for that denial-of-service attack that is Hacktoberfest, I am closing all pull requests that do not have passing tests.

@cclauss cclauss closed this Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed stale Used to mark an issue or pull request stale. tests are failing Do not merge until tests pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants