Closed
Conversation
updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.3 → v0.9.7](astral-sh/ruff-pre-commit@v0.7.3...v0.9.7)
This PR improves docstrings for Elemwise functions by: 1. Modifying scalar_elemwise to no longer append the generic Elemwise docstring 2. Enhancing docstrings for specific mathematical functions (exp, log, eq) with: - Better formatted NumPy-style documentation - Clear descriptions of functionality - Practical usage examples - Additional notes on potential pitfalls This fixes issue #292 which noted that current Elemwise docstrings are not very helpful due to excessive generic boilerplate. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
ricardoV94
reviewed
Mar 3, 2025
Member
ricardoV94
left a comment
There was a problem hiding this comment.
We merged it already, I thought you saw it: #1255
|
|
||
| Notes | ||
| ----- | ||
| This function supports the Python syntax `a == b` when used with PyTensor tensors. |
Member
There was a problem hiding this comment.
Weird to say this, a == b is explicitly not supported, I guess an "equivalent" is missing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR continues and completes the work started in PR #830, improving docstrings for Elemwise functions.
The changes include:
The enhanced docstrings follow the NumPy-style with Parameters, Returns, and Examples sections, making them much more useful for both new and experienced users.
Related Issue
ElemwiseOps are not very helpful #292 - DOC: Docstrings for \ \s are not very helpfulThis replaces PR #830 which was stalled.
📚 Documentation preview 📚: https://pytensor--1259.org.readthedocs.build/en/1259/