A lot of error messages have been written assuming that the user would hit it "directly" (i.e. when coding in some interactive environment like a Jupyter notebook). Take for example this error:
ValueError("All samples of an amplitude waveform must be greater than or equal to zero.")
This is fine if the user just tried to create a Pulse. However, if it happens deep inside some function in the code base, potentially coming from the building of some parametrized sequence, it can be harder to tell what is going on. An immediate improvement would be to just add more information in the message, e.g.
ValueError(f"All samples of an amplitude waveform must be greater than or equal to zero; got negative values for waveform {amp_wf}")
This alone might help narrow down where the error is coming from.
We should do this judiciously throughout the codebase.
A lot of error messages have been written assuming that the user would hit it "directly" (i.e. when coding in some interactive environment like a Jupyter notebook). Take for example this error:
This is fine if the user just tried to create a
Pulse. However, if it happens deep inside some function in the code base, potentially coming from the building of some parametrized sequence, it can be harder to tell what is going on. An immediate improvement would be to just add more information in the message, e.g.This alone might help narrow down where the error is coming from.
We should do this judiciously throughout the codebase.