RasQberry
RasQberry copied to clipboard
python read of boolean variables in rasqberry_environment.env corrupt
There is an issue with reading Boolean variable in rasqberry_environment.env from python.
For example, in demos/bin/RasQ-LED-display.py, the variable "LED_INVERT" is not read correctly. The following log output:
LED_INVERT = bool(config["LED_INVERT"])
print("LED_INVERT ", LED_INVERT)
LED_INVERT = config["LED_INVERT"]
print("LED_INVERT ", LED_INVERT)
LED_INVERT = False
print("LED_INVERT ", LED_INVERT)
results in
build circuit without entanglement
measurement: 0110001001101001010011001101001110001100100110001101000010100110101110001101000000100000110001100111101110010011110011000001100
LED_INVERT True
LED_INVERT false
LED_INVERT False
Only the last setting leads to the desired result.
workaround implemented in #137
using
LED_INVERT = bool(config["LED_INVERT"]=="true" or config["LED_INVERT"]=="True")
instead of
LED_INVERT = bool(config["LED_INVERT"])
in file demos/bin/RasQ-LED-display.py (and other files).