-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
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 rank of matrix in linear algebra #8687
Conversation
linear_algebra/src/Rank_of_Matrix.py
Outdated
""" BY - RUDRANSH BHARDWAJ""" | ||
|
||
|
||
def swapRows(a, row1, row2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To resolve ruff
errors, you should rename these functions to use lowercase letters. For example, you could rename "swapRows" to "swap_rows", "Row_Transformation" to "row_transformation", and "MatrixRank" to "matrix_rank".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok let me try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message you received in pre-commit
indicates that the file "Rank_of_Matrix.py" contains uppercase characters in its filename, which violates a common naming convention for Python files.
To resolve this error, you should rename the file to use lowercase letters instead. For example, you could rename it to "rank_of_matrix.py" instead.
There was a problem hiding this 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.
linear_algebra/src/Rank_of_Matrix.py
Outdated
""" BY - RUDRANSH BHARDWAJ""" | ||
|
||
|
||
def swap_rows(a, row1, row2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file linear_algebra/src/Rank_of_Matrix.py
, please provide doctest for the function swap_rows
Please provide return type hint for the function: swap_rows
. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide descriptive name for the parameter: a
Please provide type hint for the parameter: a
Please provide type hint for the parameter: row1
Please provide type hint for the parameter: row2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i will try
Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bot, so no need to reply...just do as it suggests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
linear_algebra/src/Rank_of_Matrix.py
Outdated
return a | ||
|
||
|
||
def Row_Transformation(a, x, row1, row2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file linear_algebra/src/Rank_of_Matrix.py
, please provide doctest for the function Row_Transformation
Please provide return type hint for the function: Row_Transformation
. If the function does not return a value, please provide the type hint as: def function() -> None:
Variable and function names should follow the snake_case
naming convention. Please update the following name accordingly: Row_Transformation
Please provide descriptive name for the parameter: a
Please provide type hint for the parameter: a
Please provide descriptive name for the parameter: x
Please provide type hint for the parameter: x
Please provide type hint for the parameter: row1
Please provide type hint for the parameter: row2
linear_algebra/src/Rank_of_Matrix.py
Outdated
return a | ||
|
||
|
||
def MatrixRank(a): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file linear_algebra/src/Rank_of_Matrix.py
, please provide doctest for the function MatrixRank
Please provide return type hint for the function: MatrixRank
. If the function does not return a value, please provide the type hint as: def function() -> None:
Variable and function names should follow the snake_case
naming convention. Please update the following name accordingly: MatrixRank
Please provide descriptive name for the parameter: a
Please provide type hint for the parameter: a
There was a problem hiding this 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.
linear_algebra/src/Rank_of_Matrix.py
Outdated
""" BY - RUDRANSH BHARDWAJ""" | ||
|
||
|
||
def swap_rows(a, row1, row2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file linear_algebra/src/Rank_of_Matrix.py
, please provide doctest for the function swap_rows
Please provide return type hint for the function: swap_rows
. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide descriptive name for the parameter: a
Please provide type hint for the parameter: a
Please provide type hint for the parameter: row1
Please provide type hint for the parameter: row2
linear_algebra/src/Rank_of_Matrix.py
Outdated
return a | ||
|
||
|
||
def row_transformation(a, x, row1, row2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file linear_algebra/src/Rank_of_Matrix.py
, please provide doctest for the function row_transformation
Please provide return type hint for the function: row_transformation
. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide descriptive name for the parameter: a
Please provide type hint for the parameter: a
Please provide descriptive name for the parameter: x
Please provide type hint for the parameter: x
Please provide type hint for the parameter: row1
Please provide type hint for the parameter: row2
linear_algebra/src/Rank_of_Matrix.py
Outdated
return a | ||
|
||
|
||
def matrix_rank(a): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file linear_algebra/src/Rank_of_Matrix.py
, please provide doctest for the function matrix_rank
Please provide return type hint for the function: matrix_rank
. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide descriptive name for the parameter: a
Please provide type hint for the parameter: a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly rename as I have suggested
I want 1 week because i had found some bugs in file |
i had completed all but failing in changing the file name |
now all the errors and naming patterns are corrected except the name |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be rank_of_matrix.py because it is a standard practice to write file name in lowercase.
finnally after trying for 2hrs i renamed the file |
doneee |
and thank you for your feedbacks |
....is it ok to merge pull request or it is not okay |
.....can you merge this fork |
I'm just a contributor, I don't have write access. |
how can i ask him for review?? |
>>> rank_of_matrix([[3,2,1], | ||
... [-6,-4,-2]]) | ||
1 | ||
>>> rank_of_matrix([[],[]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add: >>> rank_of_matrix([[]])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok sir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope this is ready to merge
and thanks to @rohan472000 and @cclauss for their feedbacks and suggestions
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
@cclauss please review and merge this (if it is ready) |
I think now this is okk/? |
mypy.....................................................................Failed
linear_algebra/src/rank_of_matrix.py:66: error: No overload variant of "setitem" of "list" matches argument types "int", "float" [call-overload] |
i didnt understand ??? is there any error in code or something else??? I dont understand "mypy" sorry sir for disturbing you but please help meeeeeee?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rudransh61 Merge my commit and the checks will pass
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
checks are not showing error
oooooooooooo Thankakanakankankaaaasssss brooooo FOR HELPING MEEEEEEEEEEEEEE you r genius ???? you are pro coderrr @CaedenPH |
broooo you aree god |
I think now it is ready to deploy?? |
Thanks to all reviews and other developers to help mee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this!
* Added rank of matrix in linear algebra * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Corrected name of function * Corrected Rank_of_Matrix.py * Completed rank_of_matrix.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * delete to rename Rank_of_Matrix.py * created rank_of_matrix * added more doctests in rank_of_matrix.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed some issues in rank_of_matrix.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added moreeee doctestsss in rank_of_mtrix.py and fixed some bugss * Update linear_algebra/src/rank_of_matrix.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update linear_algebra/src/rank_of_matrix.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update linear_algebra/src/rank_of_matrix.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update rank_of_matrix.py * Update linear_algebra/src/rank_of_matrix.py Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Hi i am rudransh ,
I added a python file to find rank of matrix because i cannot find it anywhere in code base .
So, i thought that "lets contribute ".
Please try to pull this so that the set of algorithm will be completed.
If there is any error , inform me i will try to correct this.
AND AT LAST I WOULD LIKE TO SAY PLEASE SET IT UP IN A VIRTUAL ENVIRONMENT SO THAT NEW VERSIONS OF REQUIREMENT AND PYTHON WILL NOT AFFECT ANYONE..
THANK YOU FOR READING THIS
A PROGRAMMER
RUDRANSH BHARDWAJ