Skip to content

docs: document explicit input errors - #1905

Merged
vprusso merged 2 commits into
vprusso:masterfrom
happykawayigt:docs/cyclic-permutation-raises
Aug 1, 2026
Merged

docs: document explicit input errors#1905
vprusso merged 2 commits into
vprusso:masterfrom
happykawayigt:docs/cyclic-permutation-raises

Conversation

@happykawayigt

@happykawayigt happykawayigt commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

Documents explicit input-validation exceptions in five public APIs as part of #1888.

Changes

  • Add Google-style Raises sections to cyclic_permutation, amplitude_damping, bitflip, phase_damping, and ldot_channel.
  • Cover invalid types, invalid probability/damping ranges, non-positive dimensions, and invalid LDOT matrix dimensions.

Validation

  • ruff check on all five modified modules
  • ruff format --check on all five modified modules
  • Targeted tests for all five APIs (56 passed)
  • Imported cyclic_permutation and verified the rendered docstring contains Raises:
  • git diff --check
  • GitHub Actions test and style checks passed

A full local MkDocs build was not run because mkdocs is unavailable in the local environment. The repository's Docs Preview check was skipped by its workflow configuration.

@happykawayigt happykawayigt changed the title docs: document cyclic permutation errors docs: document explicit input errors Jul 30, 2026
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@happykawayigt
happykawayigt marked this pull request as ready for review July 30, 2026 19:14
@vprusso

vprusso commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Thanks @happykawayigt. I checked each Raises: entry against the actual validation code: amplitude_damping raises on both prob and gamma out of [0,1], bitflip on prob, phase_damping on gamma, ldot_channel on non-square and non-perfect-square dimension, and cyclic_permutation raises TypeError for non-integer n/k and ValueError for non-positive n. All five match. The added \([0,1]\) text is in raw docstrings, so no escape-sequence issue. Merging.

@vprusso
vprusso merged commit e6fba4f into vprusso:master Aug 1, 2026
15 checks passed
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