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

typo in variable name needs good error message #48

Open
ahelsing opened this issue Jun 18, 2019 · 0 comments
Open

typo in variable name needs good error message #48

ahelsing opened this issue Jun 18, 2019 · 0 comments

Comments

@ahelsing
Copy link
Contributor

My code had a typo, but QGL2 gave no good error; provide a good error message with line number:

            X90m(qubi, dragScaling=dragScaling)

And I got a nasty stacktrace:

2019-06-18 19:44:33.314327: CALLING EVALUATOR
Traceback (most recent call last):
  File "./FlipFlop.py", line 153, in <module>
    main()
  File "./FlipFlop.py", line 128, in main
    (q, np.linspace(0, 5e-6, 11), 10))
  File "/home/ahelsing/Projects/Quantum/pyqgl2/src/python/pyqgl2/main.py", line 278, in compile_function
    ptree1 = evaluator.visit(ptree1)
  File "/home/ahelsing/Projects/Quantum/pyqgl2/src/python/pyqgl2/eval.py", line 954, in visit
    node.body = self.do_body(node.body)
  File "/home/ahelsing/Projects/Quantum/pyqgl2/src/python/pyqgl2/eval.py", line 1684, in do_body
    success, new_stmnts = self.do_for(stmnt)
  File "/home/ahelsing/Projects/Quantum/pyqgl2/src/python/pyqgl2/eval.py", line 1172, in do_for
    new_body = self.do_body(new_body)
  File "/home/ahelsing/Projects/Quantum/pyqgl2/src/python/pyqgl2/eval.py", line 1684, in do_body
    success, new_stmnts = self.do_for(stmnt)
....
    self.call_checker(stmnt.value.qgl2_check_vector)
  File "/home/ahelsing/Projects/Quantum/pyqgl2/src/python/pyqgl2/eval.py", line 1465, in call_checker
    value = local_variables[mapped_name]
KeyError: 'qubi'
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

No branches or pull requests

1 participant