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

Create apparent_power.py #8664

Merged
merged 16 commits into from
Apr 18, 2023
Merged

Create apparent_power.py #8664

merged 16 commits into from
Apr 18, 2023

Conversation

rohan472000
Copy link
Contributor

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 include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@algorithms-keeper algorithms-keeper bot added awaiting reviews This PR is ready to be reviewed tests are failing Do not merge until tests pass labels Apr 17, 2023
@algorithms-keeper algorithms-keeper bot removed the tests are failing Do not merge until tests pass label Apr 17, 2023
rohan472000 and others added 3 commits April 18, 2023 00:29
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
@algorithms-keeper algorithms-keeper bot added awaiting changes A maintainer has requested changes to this PR tests are failing Do not merge until tests pass and removed awaiting reviews This PR is ready to be reviewed labels Apr 17, 2023
Co-authored-by: Christian Clauss <cclauss@me.com>
@algorithms-keeper algorithms-keeper bot added awaiting reviews This PR is ready to be reviewed and removed awaiting changes A maintainer has requested changes to this PR labels Apr 17, 2023
@algorithms-keeper algorithms-keeper bot removed the tests are failing Do not merge until tests pass label Apr 17, 2023
@EngineerMarek
Copy link

Shouldn't we call this something like abs_apparent_power? This is only the absolute value of apparent power calculated from the pythagorean theorem, but it does not include the phase. Though I don't know how you guys would like to implement complex numbers for that or if there is already an implementation/a standart for that

@cclauss
Copy link
Member

cclauss commented Apr 17, 2023

Or should we raise ValueError("real_power must not be negative")

@algorithms-keeper algorithms-keeper bot added the tests are failing Do not merge until tests pass label Apr 18, 2023
@rohan472000
Copy link
Contributor Author

Shouldn't we call this something like abs_apparent_power? This is only the absolute value of apparent power calculated from the pythagorean theorem, but it does not include the phase. Though I don't know how you guys would like to implement complex numbers for that or if there is already an implementation/a standart for that

I tried to implement that, have a look.

@algorithms-keeper algorithms-keeper bot removed the tests are failing Do not merge until tests pass label Apr 18, 2023
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.

Awesome!! Thanks for your contribution.

@algorithms-keeper algorithms-keeper bot removed the awaiting reviews This PR is ready to be reviewed label Apr 18, 2023
@cclauss cclauss merged commit b5047cf into TheAlgorithms:master Apr 18, 2023
@rohan472000
Copy link
Contributor Author

The one thing that I forgot to ask for is a URL to a Wikipedia article or some other source that explains the algorithm and where/when it should be used. This can be a great help to visitors to our repo. If you create a pull request that adds https://en.wikipedia.org/wiki/AC_power#Apparent_power or something similar to the docstring then I will gladly review it.

sure...done that, please have a look.

tianyizheng02 pushed a commit to tianyizheng02/Python that referenced this pull request May 29, 2023
* Create apparent_power.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update apparent_power.py

* Update apparent_power.py

* Update apparent_power.py

* Update electronics/apparent_power.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update electronics/apparent_power.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update apparent_power.py

* Update electronics/apparent_power.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update apparent_power.py

* Update apparent_power.py

* Update apparent_power.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update apparent_power.py

* Update apparent_power.py

* Update apparent_power.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
sedatguzelsemme pushed a commit to sedatguzelsemme/Python that referenced this pull request Sep 15, 2024
* Create apparent_power.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update apparent_power.py

* Update apparent_power.py

* Update apparent_power.py

* Update electronics/apparent_power.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update electronics/apparent_power.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update apparent_power.py

* Update electronics/apparent_power.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update apparent_power.py

* Update apparent_power.py

* Update apparent_power.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update apparent_power.py

* Update apparent_power.py

* Update apparent_power.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
@isidroas isidroas mentioned this pull request Jan 25, 2025
14 tasks
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