From 1c0f1ae336080adf75f34d463d990e249fe6059f Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Wed, 27 Jul 2022 09:49:59 +0000 Subject: [PATCH] L2SS-515: more f-strings, simpler boolean formula --- .../tangostationcontrol/devices/observation_control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tangostationcontrol/tangostationcontrol/devices/observation_control.py b/tangostationcontrol/tangostationcontrol/devices/observation_control.py index 4a1bb9f0c..a2521d451 100644 --- a/tangostationcontrol/tangostationcontrol/devices/observation_control.py +++ b/tangostationcontrol/tangostationcontrol/devices/observation_control.py @@ -199,7 +199,7 @@ class ObservationControl(lofar_device): self.stop_observation(obs_id) else: # The observation that we are trying to process is not part of the running_obs dictionary - logger.warning("Received an observation_running event for the observation with ID=%s. According to the records in ObservationControl, this observation is not supposed to run. Please check previous logs, especially around the time an observation with this ID was started. Will continue and ignore this event.", obs_id) + logger.warning(f"Received an observation_running event for the observation with ID={obs_id}. According to the records in ObservationControl, this observation is not supposed to run. Please check previous logs, especially around the time an observation with this ID was started. Will continue and ignore this event.") return @only_when_on() @@ -404,7 +404,7 @@ class ObservationControl(lofar_device): error = f"Cannot check if an observation with ID={obs_id} is running, because the observation ID is invalid" Except.throw_exception("IllegalCommand", error, __name__) observation = self.running_observations.get(obs_id) - return True if observation is not None else False + return observation is not None @command(dtype_out = DevBoolean) @only_when_on() -- GitLab