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

Add docstrings in numpy #617

Merged
merged 2 commits into from
Jul 26, 2023

Conversation

guillaumebaquiast
Copy link
Contributor

Add more docstrings to functions in ops.numpy.

Covers all remaining functions starting with "a":

  • append
  • arange
  • arccos
  • arcsin
  • arctan
  • arctan2
  • argmax
  • argmin
  • argsort
  • array
  • average

I largely copied the docs from numpy, adapting them when the arguments differed.

Copy link
Contributor

@fchollet fchollet left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!


Example:
>>> x = keras_core.ops.convert_to_tensor([1, -1])
array([0. , 3.1415927], dtype=float32)
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove the extra whitespace


The quadrant (i.e., branch) is chosen so that `arctan2(x1, x2)` is the
signed angle in radians between the ray ending at the origin and passing
through the point (1,0), and the ray ending at the origin and passing
Copy link
Contributor

Choose a reason for hiding this comment

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

Use backticks around code keywords (and space after ,)

The quadrant (i.e., branch) is chosen so that `arctan2(x1, x2)` is the
signed angle in radians between the ray ending at the origin and passing
through the point (1,0), and the ray ending at the origin and passing
through the point (x2, x1). (Note the role reversal: the “y-coordinate” is
Copy link
Contributor

Choose a reason for hiding this comment

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

Use " as the quote character

Copy link
Contributor

@fchollet fchollet left a comment

Choose a reason for hiding this comment

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

LGTM -- thank you!

@fchollet fchollet merged commit 32d1dbe into keras-team:main Jul 26, 2023
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.

2 participants