Report the offending input in the devices module error messages - #1104
Open
jaewonyun1234 wants to merge 2 commits into
Open
Report the offending input in the devices module error messages#1104jaewonyun1234 wants to merge 2 commits into
jaewonyun1234 wants to merge 2 commits into
Conversation
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.
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.
Hi @a-corni, @HGSilveri,
This covers the whole devices module (11 messages: 8 in
_device_datacls.py, 3 inexceptions/sequence.py).Left unchanged: SLM without a DMM, the incompatible-layout wrapper (the original error is still chained), specifying both
noise_modelanddefault_noise_model, andvalidate_layout_fillingon a register with no layout. Those describe a config/state, not a useful extra value to dump.Partially addresses #1057.