Skip to content

Report the offending input in the devices module error messages - #1104

Open
jaewonyun1234 wants to merge 2 commits into
pasqal-io:developfrom
jaewonyun1234:devices-module-error-messages
Open

Report the offending input in the devices module error messages#1104
jaewonyun1234 wants to merge 2 commits into
pasqal-io:developfrom
jaewonyun1234:devices-module-error-messages

Conversation

@jaewonyun1234

@jaewonyun1234 jaewonyun1234 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Hi @a-corni, @HGSilveri,

This covers the whole devices module (11 messages: 8 in _device_datacls.py, 3 in exceptions/sequence.py).

Left unchanged: SLM without a DMM, the incompatible-layout wrapper (the original error is still chained), specifying both noise_model and default_noise_model, and validate_layout_filling on a register with no layout. Those describe a config/state, not a useful extra value to dump.

Partially addresses #1057.

Error messages that only stated a rule now also report the value that broke it. Type checks print the type only. Three exception classes already stored the invalid value but never printed it.
Follows the wording agreed on pasqal-io#1097:

- The five type checks now share one shape, "must be an instance of
  'X', not <type>", instead of the four different phrasings they had.
- The channel id/object count mismatch reports the two counts with
  'vs.' and drops the id dump, matching RegisterLayout's equivalent
  message.
- validate_layout_filling goes back to its original text: a register
  with no layout has no offending value to report, only an absence.
- Removes a stray space before the semicolon in the DMM name clash
  message.
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