Skip to content
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

Added physical pressure units #5613

Merged
merged 5 commits into from Oct 26, 2021
Merged

Conversation

Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
@SabariGanesh-K
Copy link
Contributor

@SabariGanesh-K SabariGanesh-K commented Oct 26, 2021

This uses tuple pair which stores units required to be converted to respective other units as mentioned.
Available Units:- Pascal,Bar,Kilopascal,Megapascal,psi(pound per square inch),inHg(in mercury column),torr,atm

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}.
This uses tuple pair which stores units required to be converted to respective other units as mentioned.
Available Units:- Pascal,Bar,Kilopascal,Megapascal,psi(pound per square inch),inHg(in mercury column),torr,atm
File was formatted as per repo rules
@SabariGanesh-K
Copy link
Contributor Author

@SabariGanesh-K SabariGanesh-K commented Oct 26, 2021

I did 2 conversion algorithm for the past 1 week . First one has been merged and this is the second one.
I am opening separate PR for this as it was mentioned in the rule to open separate PR for different algorithms.
@cclauss The tests are passing:) If you have any suggestions/Changes you may convey , else you may merge it !!

@cclauss
Copy link
Member

@cclauss cclauss commented Oct 26, 2021

Is there are a separate source of conversions on the internet that can confirm our results?

@SabariGanesh-K
Copy link
Contributor Author

@SabariGanesh-K SabariGanesh-K commented Oct 26, 2021

I have a website , but that's not wikipedia. Shall I add it ? https://msestudent.com/what-are-the-units-of-pressure/
This is the website. @cclauss

@SabariGanesh-K
Copy link
Contributor Author

@SabariGanesh-K SabariGanesh-K commented Oct 26, 2021

I have added reference website which has relevant unitary data .

@SabariGanesh-K
Copy link
Contributor Author

@SabariGanesh-K SabariGanesh-K commented Oct 26, 2021

Alternatively you can google corresponding unitary value (like 1Pa to atm ) to evaluate multiplier needed

@cclauss
Copy link
Member

@cclauss cclauss commented Oct 26, 2021

I was not referring to our unitary values. I was referring to going to a website that does conversions and then putting in our doctest values to see if their conversions match ours.

@SabariGanesh-K
Copy link
Contributor Author

@SabariGanesh-K SabariGanesh-K commented Oct 26, 2021

@SabariGanesh-K
Copy link
Contributor Author

@SabariGanesh-K SabariGanesh-K commented Oct 26, 2021

@cclauss I have added website in reference which helps in converting between pressure units directly like how you asked.

Copy link
Member

@cclauss cclauss left a comment

doctest results match well with unitconverters.net

@cclauss cclauss merged commit 582f57f into TheAlgorithms:master Oct 26, 2021
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment