Skip to content

docs: use lowercase parameter names in channel_dim error messages#1889

Open
armorbreak001 wants to merge 2 commits into
vprusso:masterfrom
armorbreak001:fix/error-msg-lowercase-params
Open

docs: use lowercase parameter names in channel_dim error messages#1889
armorbreak001 wants to merge 2 commits into
vprusso:masterfrom
armorbreak001:fix/error-msg-lowercase-params

Conversation

@armorbreak001

Copy link
Copy Markdown

Summary

Fixes 6 user-facing ValueError messages in channel_dim.py that referenced parameters by their MATLAB/QETLAB-style uppercase names (PHI, DIM) instead of the actual Python parameter names (phi, dim).

Problem

When a user hit one of these errors, they could not map PHI or DIM to any argument they had passed, since the function signature uses lowercase phi and dim.

Changes

Before After
"The input and output spaces of PHI must be square." "The input and output spaces of phi must be square."
"The dimensions of PHI do not match those provided in the DIM argument." "The dimensions of phi do not match those provided in the dim argument."
"The Kraus operators of PHI do not all have the same size." "The Kraus operators of phi do not all have the same size."
"If ... PHI is provided ... DIM must be specified ... agree with PHI" "If ... phi is provided ... dim must be specified ... agree with phi"

Developer-facing comments are unchanged.

Fixes #1885

User-facing ValueError messages referenced parameters by their
MATLAB/QETLAB-style uppercase names (PHI, DIM) instead of the
actual Python parameter names (phi, dim). This made it impossible
for users to map errors to their code.

Updated all 6 error messages in channel_dim.py to use lowercase
phi/dim matching the function signature.

Fixes vprusso#1885
@vprusso

vprusso commented Jul 25, 2026

Copy link
Copy Markdown
Owner

@armorbreak001 your build is failing

The PR changed error messages to use lowercase parameter names
but this test still expected uppercase DIM.
@armorbreak001

Copy link
Copy Markdown
Author

Thanks for the heads-up! Fixed the test expectation — it was still checking for uppercase DIM but the error message now uses lowercase dim. Updated test should pass now.

@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

docs: use actual lowercase parameter names in error messages

2 participants