Skip to content

Added length unit conversions #5373

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

Merged
merged 14 commits into from
Oct 19, 2021
Merged

Added length unit conversions #5373

merged 14 commits into from
Oct 19, 2021

Conversation

SabariGanesh-K
Copy link
Contributor

Conversion of length units were added with respective tests being implemented and passed.
Available Units:- Metre,Kilometre,Feet,Inch,Centimeter,Yard,Foot,Mile,Millimeter

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}.

Conversion of length units were added with respective tests being implemented and passed.
Available Units:- Metre,Kilometre,Feet,Inch,Centimeter,Yard,Foot,Mile,Millimeter
@ghost ghost added awaiting reviews This PR is ready to be reviewed tests are failing Do not merge until tests pass labels Oct 17, 2021
@ghost ghost removed the tests are failing Do not merge until tests pass label Oct 17, 2021
@SabariGanesh-K
Copy link
Contributor Author

The tests have been passed :)

@SabariGanesh-K
Copy link
Contributor Author

@cclauss The tests have been passed. Let me know if I can do anymore changes/contribution !!

Copy link
Member

@l3str4nge l3str4nge left a comment

Choose a reason for hiding this comment

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

Please add one more test

@ghost ghost added awaiting changes A maintainer has requested changes to this PR and removed awaiting reviews This PR is ready to be reviewed labels Oct 18, 2021
@ghost ghost added awaiting reviews This PR is ready to be reviewed and removed awaiting changes A maintainer has requested changes to this PR labels Oct 18, 2021
Added test to evaluate whether the code handles wrong arguements passed
@ghost ghost added the tests are failing Do not merge until tests pass label Oct 18, 2021
@SabariGanesh-K
Copy link
Contributor Author

The tests are passing in my Pycharm with doctests().But why is it failing here in pre-commit ? It initially passed too before this change!! Any reason why ?

@cclauss
Copy link
Member

cclauss commented Oct 18, 2021

conversions/length_conversions.py:106:89: E501 line too long (96 > 88 characters)

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.

LGTM

@ghost ghost removed the awaiting reviews This PR is ready to be reviewed label Oct 18, 2021
@ghost ghost added the awaiting reviews This PR is ready to be reviewed label Oct 19, 2021
One of the test was failing and it was fixed
@ghost ghost removed the tests are failing Do not merge until tests pass label Oct 19, 2021
@SabariGanesh-K
Copy link
Contributor Author

@cclauss Thank you for the kind help you did. I myself have fixed the errors too which the program you wrote met with and the code have now passed all the test. @l3str4nge The code has passed the test !! :)

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.

LGTM. Thanks for the cleanup. I was trying to fix things in Pythonista on my iPad (imperfect ;-) )and was just switching to my MacBook when I saw that you already cleaned things up.

@ghost ghost removed the awaiting reviews This PR is ready to be reviewed label Oct 19, 2021
@cclauss cclauss dismissed l3str4nge’s stale review October 19, 2021 05:25

The requested test was added.

@cclauss cclauss merged commit 66c96aa into TheAlgorithms:master Oct 19, 2021
shermanhui pushed a commit to shermanhui/Python that referenced this pull request Oct 22, 2021
* Added length unit conversions

Conversion of length units were added with respective tests being implemented and passed.
Available Units:- Metre,Kilometre,Feet,Inch,Centimeter,Yard,Foot,Mile,Millimeter

* Formatted File

File was formatted to go as per repo rules

* Reformatted file

* Reformatted code once again

* Added more test 

Added test to evaluate whether the code handles wrong arguements passed

* Update length_conversions.py

* Update length_conversions.py

* Update length_conversions.py

* Update length_conversions.py

* Update length_conversions.py

* Update length_conversions.py

* Update length_conversions.py

* Fixed  Minor errors in test

One of the test was failing and it was fixed

Co-authored-by: Christian Clauss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants