Skip to content

Conversation

@DasithEdirisinghe
Copy link

@DasithEdirisinghe DasithEdirisinghe commented Oct 20, 2020

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.
  • 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.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@TravisBuddy
Copy link

Travis tests have failed

Hey @DasithEdirisinghe,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: e7cb9d20-12df-11eb-8230-47bfa5f272e1

@DasithEdirisinghe
Copy link
Author

@TravisBuddy what is the log. is there any link?

@TravisBuddy
Copy link

Travis tests have failed

Hey @DasithEdirisinghe,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 602940f0-12e1-11eb-8230-47bfa5f272e1

@TravisBuddy
Copy link

Travis tests have failed

Hey @DasithEdirisinghe,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 18684e90-12e2-11eb-8230-47bfa5f272e1

@TravisBuddy
Copy link

Travis tests have failed

Hey @DasithEdirisinghe,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 69358250-12e4-11eb-8230-47bfa5f272e1

@TravisBuddy
Copy link

Travis tests have failed

Hey @DasithEdirisinghe,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 2259bfd0-12e5-11eb-8230-47bfa5f272e1

@DasithEdirisinghe
Copy link
Author

@cclauss could you please help me.what is the error.I am new to this kind of issues.

@cclauss
Copy link
Member

cclauss commented Oct 20, 2020

@TravisBuddy
Copy link

Travis tests have failed

Hey @DasithEdirisinghe,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: c7ae79c0-12f5-11eb-8230-47bfa5f272e1

@DasithEdirisinghe
Copy link
Author

@cclauss I cant find the issue as the code is locally working properly.What is the issue.could you please help me?

Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

All functions need doctests, type hints on function parameters and return vaules, real variable names.

self.v = vertices
self.graph = defaultdict(list)

def addEdge(self, u, v):
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
def addEdge(self, u, v):
def add_edge(self, universal: int, victorious: float) -> list[int]:

Don't force your reader to guess. Type hints are required in this repo so the caller knows what datatypes the functions expect and what datatype they return.

Single -letter variable names for function parameters is the way that programs were written in the 1950's and 60's. In modern times, we no longer force users to guess what variables mean. Instead, we give them self-documenting names.

Copy link
Author

Choose a reason for hiding this comment

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

okay thank you


self.addEdge(u, v)

return False if count1 > count2 else True
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
return False if count1 > count2 else True
return count1 <= count2

@cclauss cclauss added the hacktoberfest-accepted Accepted to be counted towards Hacktoberfest label Oct 20, 2020
@poyea
Copy link
Member

poyea commented Oct 29, 2020

Remember to add the hacktoberfest tag in your fork repo.

@DasithEdirisinghe
Copy link
Author

Remember to add the hacktoberfest tag in your fork repo.

How to add that tag.could you please help me

@stale
Copy link

stale bot commented Nov 28, 2020

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 Nov 28, 2020
@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 Nov 28, 2020
@stale stale bot removed the stale Used to mark an issue or pull request stale. label Nov 28, 2020
@ghost ghost added the tests are failing Do not merge until tests pass label Nov 28, 2020
@dhruvmanila
Copy link
Member

@algorithms-keeper review

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 only modify the labels accordingly.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

self.v = vertices
self.graph = defaultdict(list)

def add_edge(self, u, v) -> 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 doctest for the function: add_edge

self.graph[u].append(v)
self.graph[v].append(u)

def remove_edge(self, u, v) -> 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 doctest for the function: remove_edge

if key == u:
self.graph[v].pop(index)

def depth_first_search_count(self, v, visited) -> int:
Copy link

Choose a reason for hiding this comment

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

Please provide doctest for the function: depth_first_search_count

count = count + self.dfs_count(i, visited)
return count

def is_valid_next_edge(self, u, v) -> bool:
Copy link

Choose a reason for hiding this comment

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

Please provide doctest for the function: is_valid_next_edge


return count1 <= count2

def print_euler_util(self, u) -> 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 doctest for the function: print_euler_util

self.graph[u].append(v)
self.graph[v].append(u)

def remove_edge(self, u, v) -> 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 argument: v

if key == u:
self.graph[v].pop(index)

def depth_first_search_count(self, v, visited) -> int:
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 argument: v

count = count + self.dfs_count(i, visited)
return count

def is_valid_next_edge(self, u, v) -> bool:
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 argument: u

count = count + self.dfs_count(i, visited)
return count

def is_valid_next_edge(self, u, v) -> bool:
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 argument: v


return count1 <= count2

def print_euler_util(self, u) -> 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 argument: u

@stale
Copy link

stale bot commented Jan 9, 2021

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 Jan 9, 2021
@stale
Copy link

stale bot commented Jan 17, 2021

Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!

@stale stale bot closed this Jan 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Accepted to be counted towards Hacktoberfest 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 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.

5 participants