Fixed subract fn
Reformatted subtract function - #4067
Hi, any suggestions you would like for me to add?
hi @nathzi1505 , could you please add the reformatting task's checklist as per the instructions here. 😅
This should hopefully take you only a few moments, but it is very important to ensure we don't miss anything, and it decreases the review time. 😋
Thanks!
Sure @abdrahmandiab.
Reformatting Task Checklist
IMPORTANT NOTICE 🚨:
The Ivy Docs represent the ground truth for the task descriptions and this checklist should only be used as a supplementary item to aid with the review process.
LEGEND 🗺:
- ❌ : Check item is not completed.
- ✅ : Check item is ready for review.
- 🆘 : Stuck/Doubting implementation (PR author should add comments explaining why).
- ⏩ : Check is not applicable to function (skip).
- 🆗 : Check item is already implemented and does not require any edits.
CHECKS 📑:
-
- [x] ⏩ : Remove all lambda and direct bindings for the backend functions in:
-
- [x] ⏩ : Implement the following if they don't exist:
-
- [x] ⏩ : The
ivy.Arrayinstance method in ivy/array/elementwise.py.
- [x] ⏩ : The
-
- [x] ⏩ : The
ivy.Arrayspecial method in ivy/array/array.py.
- [x] ⏩ : The
-
- [x] ⏩ : The
ivy.Arrayreverse special method in ivy/array/array.py.
- [x] ⏩ : The
-
- [x] ⏩ : The
ivy.Containerstatic method in ivy/container/elementwise.py.
- [x] ⏩ : The
-
- [x] ⏩ : The
ivy.Containerinstance method in ivy/container/elementwise.py.
- [x] ⏩ : The
-
- [x] ⏩ : The
ivy.Containerspecial method in ivy/container/container.py.
- [x] ⏩ : The
-
- [x] ⏩ : The
ivy.Containerreverse special method in ivy/container/container.py.
- [x] ⏩ : The
-
- [x] ⏩ : Implement the following if they don't exist:
-
- [x] ⏩ : Make sure that the aforementioned methods are added into the correct category-specific parent class, such as
ivy.ArrayWithElementwise,ivy.ContainerWithManipulationetc.
- [x] ⏩ : Make sure that the aforementioned methods are added into the correct category-specific parent class, such as
-
- [x] ⏩ : Correct all of the Function Arguments and the type hints for every function and its relevant methods, including those you did not implement yourself.
-
- [x] ✅ : Add the correct Docstrings to every function and its relevant methods, including those you did not implement yourself. The following should be added:
-
- [x] ⏩ : The function's Array API standard description in ivy/functional/elementwise.py. If the function is not part of the Array API standard then a description of similar style should be added to the same file.
The following modifications should be made to the description:
- [x] ⏩ : Remove type definitions in the
ParametersandReturnssections. - [x] ⏩ : Add
outto theParameterssection if function accepts anoutargument. - [x] ⏩ : Replace
outwithretin theReturnssection.
- [x] ⏩ : Remove type definitions in the
- [x] ⏩ : The function's Array API standard description in ivy/functional/elementwise.py. If the function is not part of the Array API standard then a description of similar style should be added to the same file.
The following modifications should be made to the description:
-
- [x] ✅ : Reference to docstring for ivy.function_name (5.a) for the function description and modified
ParametersandReturnssections as described in the docs in:- [x] ✅ : ivy/array/elementwise.py.
- [x] ✅ : ivy/container/elementwise.py (in the static and instance method versions).
- [x] ✅ : ivy/array/array.py if the function has a special method ( like
__function_name__). - [x] ✅ : ivy/array/array.py if the function has a reverse special method ( like
__rfunction_name__). - [x] ✅ : ivy/container/container.py if the function has a special method ( like
__function_name__). - [x] ✅ : ivy/container/container.py if the function has a reverse special method ( like
__rfunction_name__).
- [x] ✅ : Reference to docstring for ivy.function_name (5.a) for the function description and modified
-
- [x] ✅ : Add the correct Docstrings to every function and its relevant methods, including those you did not implement yourself. The following should be added:
-
-
[ ] ✅: Add thorough Docstring Examples for every function and its relevant methods and ensure they pass the docstring tests.
Functional Examples in ivy/functional/elementwise.py.
-
- [x] ✅: Cover all possible variants for each of the arguments independently (not combinatorily).
-
- [x] ✅: Vary the values and input shapes considerably between examples.
-
- [x] ✅: Start out simple and get more complex with each example.
-
- [x] ✅ Show an example with:
- [x] ✅:
outunused. - [x] ✅:
outused to update a new array y. - [x] ✅:
outused to inplace update the input array x (if x has the same dtype and shape as the return).
- [x] ✅:
- [x] ✅ Show an example with:
-
- [x] ✅: If broadcasting is relevant for the function, then show examples which highlight this.
Nestable Function Examples in ivy/functional/elementwise.py. Only if the function supports nestable operations.
-
- [x] ✅: Add an example that passes in an
ivy.Containerinstance in place of one of the arguments.
- [x] ✅: Add an example that passes in an
-
- [x] ✅: Add an example passes in
ivy.Containerinstances for multiple arguments.
- [x] ✅: Add an example passes in
Container Static Method Examples in ivy/container/elementwise.py.
-
- [x] ✅ : The example from point (6.f) should be replicated, but added to the
ivy.Containerstatic method docstring in withivy.<func_name>replaced withivy.Container.static_<func_name>in the example.
- [x] ✅ : The example from point (6.f) should be replicated, but added to the
-
- [x] ✅ : The example from point (6.g) should be replicated, but added to the
ivy.Containerstatic method docstring, withivy.<func_name>replaced withivy.Container.static_<func_name>in the example.
- [x] ✅ : The example from point (6.g) should be replicated, but added to the
Array Instance Method Example in ivy/array/elementwise.py.
-
- [x] ✅ : Call this instance method of the
ivy.Arrayclass.
- [x] ✅ : Call this instance method of the
Container Instance Method Example in ivy/container/elementwise.py.
-
- [x] ✅ : Call this instance method of the
ivy.Containerclass.
- [x] ✅ : Call this instance method of the
Array Operator Examples in ivy/array/array.py.
-
- [x] ✅ : Call the operator on two
ivy.Arrayinstances.
- [x] ✅ : Call the operator on two
-
- [x] ✅ : Call the operator with an
ivy.Arrayinstance on the left andivy.Containeron the right.
- [x] ✅ : Call the operator with an
Array Reverse Operator Example in ivy/array/array.py.
-
- [x] ✅ : Call the operator with a
Numberon the left and anivy.Arrayinstance on the right.
- [x] ✅ : Call the operator with a
Container Operator Examples in ivy/container/container.py.
-
- [x] ✅ : Call the operator on two
ivy.Containerinstances containing Number instances at the leaves.
- [x] ✅ : Call the operator on two
-
- [x] ✅ : Call the operator on two
ivy.Containerinstances containingivy.Arrayinstances at the leaves.
- [x] ✅ : Call the operator on two
-
- [x] ✅ : Call the operator with an
ivy.Containerinstance on the left andivy.Arrayon the right.
- [x] ✅ : Call the operator with an
Container Reverse Operator Example in ivy/container/container.py.
-
- [x] ✅ : Following example in the
ivy.Container.__radd__docstring, with the operator called with aNumberon the left and anivy.Containerinstance on the right.
- [x] ✅ : Following example in the
Tests
-
- [x] ✅: Docstring examples tests passing.
-
- [x] ✅: Lint checks passing.
-
-
Hi @abdrahmandiab, I have added the checklist for your reference. Feel free to share any suggestions.
Hi @abdrahmandiab, I have followed the checklist and have made changes as you suggested. Feel free to review them and suggest new ones if required. Thanks.
Hi @abdrahmandiab, I have followed the checklist and have made changes as you suggested. Feel free to review them and suggest new ones if required. Thanks.
Hi @nathzi1505, sorry it took me a bit to get to this, I saw your review request a few days ago and completely forgot to do it! 😅
I am going to review this today hopefully, so be on the lookout for that soon! :) Sorry for the inconvenience and thanks!
Hey @nathzi1505 , Just finished reviewing and merging your PR, everything looks perfect to me! 😇
Thank you so much for your hard work, and I apologize once again for the late review! 😅 Well done!