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

Refactor exists #22993

Merged
merged 4 commits into from
Sep 6, 2023
Merged

Refactor exists #22993

merged 4 commits into from
Sep 6, 2023

Conversation

SpyingEnvelope
Copy link
Contributor

@SpyingEnvelope SpyingEnvelope commented Sep 4, 2023

PR Description

The docstrings, examples, hint types, and arguments for exists were mostly correct. I turned the passed in parameter to be positional only, as per the recommendations from the Ivy documentation.

I also implemented an ivy.Container instance method for exists that returns an ivy.Container detailing if any of the leaves are None.

Related Issue

This should resolve issue #22937 for reformatting exists.

Checklist

  • Did you add a function?
  • Did you add the tests? - I added docstrings tests
  • Did you follow the steps we provided?

Checklist provided by docs

  • Remove all lambda and direct bindings for the backend functions (in ivy.functional.backends), with each function instead defined using def.
  • Implement the following if they don’t exist but should do: ivy.Array instance method, ivy.Container instance method, ivy.Array special method, ivy.Array reverse special method, ivy.Container special method, ivy.Container reverse special method.
  • Make sure that the aforementioned methods are added into the correct category-specific parent class, such as ivy.ArrayWithElementwise, ivy.ContainerWithManipulation etc.
  • Correct all of the Function Arguments and the type hints for every function and its relevant methods, including those you did not implement yourself.
  • Add the correct Docstrings to every function and its relevant methods, including those you did not implement yourself.
  • Add thorough Docstring Examples for every function and its relevant methods and ensure they pass the docstring tests.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

Thanks for contributing to Ivy! 😊👏
Here are some of the important points from our Contributing Guidelines 📝:
1. Feel free to ignore the run_tests (1), run_tests (2), … jobs, and only look at the display_test_results job. 👀 It contains the following two sections:
- Combined Test Results: This shows the results of all the ivy tests that ran on the PR. ✔️
- New Failures Introduced: This lists the tests that are passing on main, but fail on the PR Fork. Please try to make sure that there are no such tests. 💪
2. The lint / Check formatting / check-formatting tests check for the formatting of your code. 📜 If it fails, please check the exact error message in the logs and fix the same. ⚠️🔧
3. Finally, the test-docstrings / run-docstring-tests check for the changes made in docstrings of the functions. This may be skipped, as well. 📚
Happy coding! 🎉👨‍💻

@ivy-leaves ivy-leaves added Array API Conform to the Array API Standard, created by The Consortium for Python Data API Standards Ivy Functional API labels Sep 4, 2023
@ivy-seed ivy-seed assigned Dsantra92 and AnnaTz and unassigned Dsantra92 Sep 4, 2023
…ces to both _static_exists and exists. I also changed the name of static_exists to _static_exists as that appears to be the more common naming convention. Updated docstrings for _static_exists and exists to include information about the new arguments added. I also updated the Returns docstring to futher specify that a container is returned which specifies if leaf nodes are None or not.
Copy link
Contributor

@AnnaTz AnnaTz left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@AnnaTz AnnaTz merged commit b384279 into ivy-llc:main Sep 6, 2023
druvdub pushed a commit to druvdub/ivy that referenced this pull request Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Array API Conform to the Array API Standard, created by The Consortium for Python Data API Standards Ivy Functional API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants