Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve exception expressiveness #262

Open
nelimee opened this issue Jul 3, 2024 · 1 comment
Open

Improve exception expressiveness #262

nelimee opened this issue Jul 3, 2024 · 1 comment
Labels
backend Issue pertaining to the Python backend (tqec package) enhancement New feature or request, may not be in the task flow help wanted Extra attention is needed QOL Improves usability and functionality question Further information is requested

Comments

@nelimee
Copy link
Contributor

nelimee commented Jul 3, 2024

Is your feature request related to a problem? Please describe.
For the moment, the code base only include one exception, TQECException, that is raised with a descriptive error message whenever an exception need to be raised. It might be beneficial to split that unique exception into several more expressive ones.

What is you opinion on that? If you agree, what should be, in your opinion, the rule to decide whether a new exception inheriting from TQECException should be included or an existing generic exception (such as TQECException) should be used?

@nelimee nelimee added enhancement New feature or request, may not be in the task flow help wanted Extra attention is needed question Further information is requested backend Issue pertaining to the Python backend (tqec package) QOL Improves usability and functionality labels Jul 3, 2024
@nelimee nelimee self-assigned this Jul 3, 2024
@Gistbatch
Copy link
Contributor

I suggest that we have exceptions for multiple situations.
Parsing the description string is easy for a user but not helpful when catching specific exceptions programmatically.

Some possible use cases:

  • InvalidCodeException: The user has specified an invalid error correction code or something similar
  • FormatException: Exceptions when switching between libraries occur, e.g., TQEC frontend, stim, cirq, collada ...
  • BrokenAssumption: If one of the assumptions throughout the code is not fulfilled, e.g. midline cannot be computed

@nelimee nelimee removed their assignment Jul 4, 2024
@nelimee nelimee added the good first issue Good for newcomers label Jul 25, 2024
@nelimee nelimee removed the good first issue Good for newcomers label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issue pertaining to the Python backend (tqec package) enhancement New feature or request, may not be in the task flow help wanted Extra attention is needed QOL Improves usability and functionality question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants