Skip to content

Is narcissistic #6052

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

Closed
wants to merge 32 commits into from
Closed

Is narcissistic #6052

wants to merge 32 commits into from

Conversation

meg-1
Copy link
Contributor

@meg-1 meg-1 commented Mar 19, 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.
  • 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}.

@meg-1 meg-1 requested a review from Kush1101 as a code owner March 19, 2022 12:58
@ghost ghost added require descriptive names This PR needs descriptive function and/or variable names awaiting reviews This PR is ready to be reviewed labels Mar 19, 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.

@@ -0,0 +1,24 @@
def is_narcissistic(i: int) -> 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 parameter: i

@ghost ghost removed the require descriptive names This PR needs descriptive function and/or variable names label Mar 23, 2022
@ghost ghost mentioned this pull request Mar 23, 2022
14 tasks
@ghost ghost mentioned this pull request Mar 23, 2022
14 tasks
@@ -0,0 +1,21 @@
def average_welford(values: list) -> float:
Copy link
Member

@poyea poyea Mar 24, 2022

Choose a reason for hiding this comment

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

Please separate different algorithms into different PRs.

Copy link
Contributor Author

@meg-1 meg-1 Mar 30, 2022

Choose a reason for hiding this comment

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

thank you! i created new branches and comitted them seperately. it seemed to work. is it possible that i might've made a mistake while comitting?? i'm not sure how to check the result of the commit so i might've not seen that they commited as a group.

Copy link
Member

Choose a reason for hiding this comment

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

So @meg-1, what you may try is to create 1 branch for 1 file (with its related changes if it applies). You may:

  1. checkout to the master branch
  2. switch to a new branch, say average-welford
  3. git add and git commit only maths/average_welford.py
  4. check using git status
  5. push it to your repository; and open a PR for that branch
  6. repeat 1-5 for other files

If you have one commit for each file, it's very easy to do this with cherry-pick otherwise you'll need some rebase which is a bit complicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you, @poyea, for the instruction! that's what i did before in my previous prs ( #6052 #6061 #6077 ). are they being displayed as one joined commit, with 3 files in it? if so then im not sure what could have gone wrong when i commited them :')

Copy link
Member

Choose a reason for hiding this comment

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

Yes. They are (you can see it in Files changed tab). If you follow the push workflow above, you get one file in each branch, linked to one PR @meg-1

Copy link
Contributor Author

@meg-1 meg-1 Apr 6, 2022

Choose a reason for hiding this comment

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

Yes. They are (you can see it in Files changed tab). If you follow the push workflow above, you get one file in each branch, linked to one PR @meg-1

ty for clarification. just checked and somehow they really did merge into one commit, 'is narcissistic' [ this pr, #6052 ]. i remember you said that the CI can sometimes not work properly, and i think this is the case for me. i did all prs exactly by the instruction steps which you recommended above, and it still merged into one pr. would you please suggest a further course of action, or any possible solutions, since i've been trying to commit for quite a long time, and even though i've been following all steps exactly, nothing seems to go through. @poyea

@poyea poyea mentioned this pull request Mar 24, 2022
14 tasks
meg-1 added 2 commits April 6, 2022 17:27
seperate pr for decrypt.py
trying to create seperate pr for decrypt.py
@ghost ghost added the tests are failing Do not merge until tests pass label Apr 8, 2022
meg-1 added 6 commits April 9, 2022 14:33
reasons: tests were failing, also wanted to divide commits.
[ there was also a syntax error here ]
added indentation to the code
@meg-1
Copy link
Contributor Author

meg-1 commented Apr 27, 2022

@Kush1101 could you please review this pr as well?

@poyea
Copy link
Member

poyea commented Apr 28, 2022

@meg-1
Copy link
Contributor Author

meg-1 commented Apr 30, 2022

There's this version: https://github.com/TheAlgorithms/Python/blob/master/maths/armstrong_numbers.py.

understood! apologies, didn't see that one. deleting #6052 right away.

@meg-1 meg-1 closed this Apr 30, 2022
@poyea
Copy link
Member

poyea commented Apr 30, 2022

You may improve that current version, like adding more tests

@meg-1
Copy link
Contributor Author

meg-1 commented May 4, 2022

is_narcissistic

thank you, i will keep that in mind!

@meg-1 meg-1 deleted the is_narcissistic branch August 13, 2022 11:23
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 tests are failing Do not merge until tests pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants