Skip to content
Snippets Groups Projects
Commit 5be12d04 authored by Karim Ahmed's avatar Karim Ahmed
Browse files

use EAFP instead of LBYL

parent 79ffc23a
No related branches found
No related tags found
1 merge request!712[Gotthard2][Dark] Process dark constants starting the 21st pulse
......@@ -26,10 +26,10 @@ class Gotthard2Ctrl():
self.run_dc[self.ctrl_src, "exposurePeriod"].as_single_value(), 4)) # noqa
def get_acquisition_rate(self):
if "acquisitionRate.value" in self.run_dc.get_run_values(self.ctrl_src): # noqa
return(
float(self.run_dc.get_run_value(
self.ctrl_src, "acquisitionRate")))
try:
return(float(self.run_dc.get_run_value(self.ctrl_src, "acquisitionRate"))) # noqa
except extra_data.PropertyNameError:
pass
def get_single_photon(self):
if "singlePhoton.value" in self.run_dc.keys_for_source(self.ctrl_src): # noqa
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment