Skip to content
Snippets Groups Projects
Verified Commit b0092b4d authored by Tobias Hangleiter's avatar Tobias Hangleiter
Browse files

Add logging

parent 1dfc408e
No related branches found
No related tags found
1 merge request!179Get gate_layout back up to speed
......@@ -4,6 +4,7 @@ Created on Mon Apr 25 11:14:02 2022
@author: Hangleiter
"""
import logging
import pathlib
import warnings
from itertools import compress
......@@ -26,7 +27,7 @@ DEFAULT_TEXT_KWARGS = dict(backgroundcolor='black',
horizontalalignment='center',
verticalalignment='center',
color='white', fontsize=8)
LOG = logging.getLogger(__name__)
class GateLayout:
......@@ -100,7 +101,10 @@ class GateLayout:
self.get_voltages(force)
elif isinstance(voltages, dict):
for gate, voltage in voltages.items():
self._latest_voltages[self.gate_names.index(gate)] = voltage
try:
self._latest_voltages[self.gate_names.index(gate)] = voltage
except ValueError:
LOG.warning(f'Gate not found. Skipping: {gate}')
else:
self._latest_voltages[:] = np.broadcast_to(voltages, self._latest_voltages.shape)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment