1
- # encoding: utf-8
1
+ # encoding: utf-8
2
2
"""Workflow runner, interfacing to external workflow engine
3
3
using Abstract Beamline Interface messages
4
4
@@ -825,7 +825,6 @@ def query_pre_strategy_params(self, choose_lattice=None):
825
825
826
826
# Convert energy field to a single tuple
827
827
params ["energies" ] = (params .pop ("energy" ),)
828
- #
829
828
return params
830
829
831
830
def pre_execute (self , queue_entry ):
@@ -1494,7 +1493,6 @@ def query_collection_strategy(self, geometric_strategy):
1494
1493
1495
1494
tag = "recentring_mode"
1496
1495
result [tag ] = RECENTRING_MODES .get (result .get (tag )) or default_recentring_mode
1497
- #
1498
1496
return result
1499
1497
1500
1498
def setup_data_collection (self , payload , correlation_id ):
@@ -1867,7 +1865,6 @@ def setup_data_collection(self, payload, correlation_id):
1867
1865
+ ", " .join ("%s:%s" % item for item in sorted (settings .items ()))
1868
1866
)
1869
1867
goniostatTranslations .append (translation )
1870
- #
1871
1868
gphl_workflow_model .goniostat_translations = goniostatTranslations
1872
1869
1873
1870
# Do it here so that any centring actions are enqueued dfirst
@@ -1967,7 +1964,6 @@ def calculate_recentring(self, okp, ref_okp, ref_xyz):
1967
1964
"%s position %s recentred to above maximum limit %s"
1968
1965
% (tag , val , limit )
1969
1966
)
1970
- #
1971
1967
return result
1972
1968
1973
1969
def collect_data (self , payload , correlation_id ):
@@ -2049,7 +2045,6 @@ def collect_data(self, payload, correlation_id):
2049
2045
acq_parameters .exp_time = scan .exposure .time
2050
2046
acq_parameters .num_passes = 1
2051
2047
2052
- ##
2053
2048
wavelength = sweep .beamSetting .wavelength
2054
2049
acq_parameters .energy = HWR .beamline .energy .calculate_energy (wavelength )
2055
2050
detdistance = sweep .detectorSetting .axisSettings ["Distance" ]
@@ -2455,7 +2450,7 @@ def parse_indexing_solution(self, choose_lattice):
2455
2450
2456
2451
else :
2457
2452
raise RuntimeError ("Indexing format %s not supported" % indexing_format )
2458
- #
2453
+
2459
2454
return header , solutions_dict , select_row
2460
2455
2461
2456
def process_centring_request (self , payload , correlation_id ):
@@ -2471,7 +2466,6 @@ def process_centring_request(self, payload, correlation_id):
2471
2466
# Rotate sample to RotationSetting
2472
2467
goniostatRotation = request_centring .goniostatRotation
2473
2468
goniostatTranslation = goniostatRotation .translation
2474
- #
2475
2469
2476
2470
if self ._data_collection_group is None :
2477
2471
gphl_workflow_model = self ._queue_entry .get_data_model ()
@@ -2523,7 +2517,7 @@ def process_centring_request(self, payload, correlation_id):
2523
2517
return_status = "DONE"
2524
2518
else :
2525
2519
return_status = "NEXT"
2526
- #
2520
+
2527
2521
return GphlMessages .CentringDone (
2528
2522
return_status ,
2529
2523
timestamp = time .time (),
@@ -2651,7 +2645,7 @@ def obtain_prior_information(self, payload, correlation_id):
2651
2645
)
2652
2646
2653
2647
priorInformation = GphlMessages .PriorInformation (workflow_model , image_root )
2654
- #
2648
+
2655
2649
return priorInformation
2656
2650
2657
2651
def handle_collection_end (
@@ -2746,7 +2740,6 @@ def resolution2dose_budget(
2746
2740
)
2747
2741
decay_limit = decay_limit or self .config .settings .get ("decay_limit" , 25 )
2748
2742
result = 2 * resolution * resolution * math .log (100.0 / decay_limit )
2749
- #
2750
2743
return min (result , max_budget ) / relative_rad_sensitivity
2751
2744
2752
2745
@staticmethod
@@ -2869,9 +2862,7 @@ def get_emulation_samples(self):
2869
2862
data [tag ] = val
2870
2863
elif tag in dfp :
2871
2864
dfp [tag ] = val
2872
- #
2873
2865
result .append (data )
2874
- #
2875
2866
return result
2876
2867
2877
2868
def get_emulation_sample_dir (self , sample_name = None ):
@@ -2900,7 +2891,6 @@ def get_emulation_sample_dir(self, sample_name=None):
2900
2891
logging .getLogger ("HWR" ).warning (
2901
2892
"No emulation sample dir found for sample %s" , sample_name
2902
2893
)
2903
- #
2904
2894
return sample_dir
2905
2895
2906
2896
def get_emulation_crystal_data (self , sample_name = None ):
@@ -2927,7 +2917,6 @@ def get_emulation_crystal_data(self, sample_name=None):
2927
2917
raise RuntimeError (
2928
2918
"No emulation data found for %s at %s " % (sample_name , sample_dir )
2929
2919
)
2930
- #
2931
2920
return crystal_data , hklfile
2932
2921
2933
2922
#
@@ -3037,7 +3026,6 @@ def update_lattice(self, values):
3037
3026
"point_groups" : {"value" : pgvalue , "enum" : pglist },
3038
3027
"space_group" : {"value" : sgvalue , "enum" : sgoptions },
3039
3028
}
3040
- #
3041
3029
return result
3042
3030
3043
3031
def update_point_groups (self , values ):
@@ -3051,7 +3039,6 @@ def update_point_groups(self, values):
3051
3039
result = {
3052
3040
"space_group" : {"value" : value , "enum" : sglist },
3053
3041
}
3054
- #
3055
3042
return result
3056
3043
3057
3044
def update_space_group (self , values ):
@@ -3075,7 +3062,6 @@ def update_space_group(self, values):
3075
3062
point_groups = crystal_class [:- 1 ]
3076
3063
if point_groups != point_groups0 :
3077
3064
result ["point_groups" ]["value" ] = point_groups
3078
- #
3079
3065
return result
3080
3066
3081
3067
def update_indexing_solution (self , values ):
@@ -3094,7 +3080,6 @@ def update_indexing_solution(self, values):
3094
3080
break
3095
3081
else :
3096
3082
result = {}
3097
- #
3098
3083
return result
3099
3084
3100
3085
def adjust_dose (self , values ):
@@ -3217,7 +3202,6 @@ def adjust_transmission(self, values):
3217
3202
dd0 = result .setdefault ("use_dose" , {})
3218
3203
dd0 ["highlight" ] = "OK"
3219
3204
result ["dose_budget" ] = {"highlight" : "OK" }
3220
- #
3221
3205
return result
3222
3206
3223
3207
0 commit comments