Skip to content

🧹 fix docstrings for gates and return_partial#112

Merged
refraction-ray merged 1 commit into
masterfrom
fix-gates-utils-docstrings-17599355194071053958
May 14, 2026
Merged

🧹 fix docstrings for gates and return_partial#112
refraction-ray merged 1 commit into
masterfrom
fix-gates-utils-docstrings-17599355194071053958

Conversation

@refraction-ray
Copy link
Copy Markdown
Member

This PR improves the maintainability and readability of the codebase by fixing docstring inaccuracies and removing obsolete TODO comments.

Key changes:

  • In tensorcircuit/gates.py, updated the num_to_tensor function's docstring to specify that it can return either a List[Tensor] or a single Tensor, and removed a TODO that was tracking this improvement.
  • In tensorcircuit/utils.py, corrected the return_partial function's docstring where the parameter was mistakenly named after the function itself instead of its actual name, return_argnums.

These changes ensure the documentation accurately reflects the implementation and helps developers better understand the utility functions.


PR created automatically by Jules for task 17599355194071053958 started by @refraction-ray

…rtial

- Update `num_to_tensor` docstring in `tensorcircuit/gates.py` to correctly reflect return type and removed outdated TODO.
- Fix `return_partial` docstring in `tensorcircuit/utils.py` by renaming the incorrect `:param return_partial:` to `:param return_argnums:`.

Co-authored-by: refraction-ray <35157286+refraction-ray@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@sonarqubecloud
Copy link
Copy Markdown

@refraction-ray refraction-ray merged commit a9741a5 into master May 14, 2026
6 of 7 checks passed
@refraction-ray refraction-ray deleted the fix-gates-utils-docstrings-17599355194071053958 branch May 14, 2026 05:39
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the documentation in tensorcircuit/gates.py and tensorcircuit/utils.py. Specifically, it refines the return type description for the num_to_tensor function to include single Tensors and corrects a parameter name in the docstring for return_partial. I have no feedback to provide as there were no review comments to evaluate.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
tensorcircuit/gates.py 95.90% <ø> (ø)
tensorcircuit/utils.py 93.57% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant