Skip to content

Commit 32585f5

Browse files
Ruff: empty-comment (PLR2044)
1 parent 5415074 commit 32585f5

23 files changed

+8
-93
lines changed

docs/conf.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#
2-
3-
41
# Configuration file for the Sphinx documentation builder.
52
#
63
# For the full list of built-in configuration values, see the documentation:

mxcubecore/Command/Sardana.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
except Exception:
5959
logging.getLogger("HWR").warning("Pytango is not available in this computer.")
6060

61-
#
62-
6361
try:
6462
import taurus
6563
from sardana.taurus.core.tango.sardana import registerExtensions

mxcubecore/HardwareObjects/CatsMaint.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ def init(self):
195195
{"type": "tango", "name": "_chnCurrentTool", "tangoname": self.tangoname},
196196
"Tool",
197197
)
198-
#
199198
self._cmdPowerOn = self.add_command(
200199
{"type": "tango", "name": "_cmdPowerOn", "tangoname": self.tangoname},
201200
"powerOn",
@@ -791,7 +790,6 @@ def _execute_server_task(self, method, *args):
791790
return ret
792791

793792
def send_command(self, cmd_name, args=None):
794-
#
795793
lid = 1
796794
toolcal = 0
797795
tool = self.get_current_tool()

mxcubecore/HardwareObjects/Gphl/CollectEmulator.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ def _get_simcal_input(self, data_collect_parameters, crystal_data):
234234
result["sweep_list"] = sweep
235235
else:
236236
result["sweep_list"] = sweeps
237-
#
238237
return result, compress_data
239238

240239
@task
@@ -352,5 +351,4 @@ def set_ulimit():
352351
else:
353352
logging.getLogger("HWR").info("Simcal collection emulation successful")
354353
self.ready_event.set()
355-
#
356354
return

mxcubecore/HardwareObjects/Gphl/GphlMessages.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,6 @@ def get_motor_settings(self):
836836
translation = self.translation
837837
if translation is not None:
838838
result.update(translation.axisSettings)
839-
#
840839
return result
841840

842841

@@ -1026,7 +1025,6 @@ def get_initial_settings(self):
10261025
"""Get dictionary of rotation and translation motor settings for start of sweep"""
10271026
result = self.goniostatSweepSetting.get_motor_settings()
10281027
result[self.goniostatSweepSetting.scanAxis] = self.start
1029-
#
10301028
return result
10311029

10321030

@@ -1154,7 +1152,6 @@ def get_ordered_sweeps(self):
11541152
for sweep in self._sweeps:
11551153
dd0 = sweep.get_initial_settings()
11561154
ll0.append((sweep.sweepGroup, tuple(dd0[x] for x in sorted(dd0)), sweep))
1157-
#
11581155
return list(tt0[2] for tt0 in sorted(ll0))
11591156

11601157

mxcubecore/HardwareObjects/Gphl/GphlWorkflow.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# encoding: utf-8
1+
# encoding: utf-8
22
"""Workflow runner, interfacing to external workflow engine
33
using Abstract Beamline Interface messages
44
@@ -825,7 +825,6 @@ def query_pre_strategy_params(self, choose_lattice=None):
825825

826826
# Convert energy field to a single tuple
827827
params["energies"] = (params.pop("energy"),)
828-
#
829828
return params
830829

831830
def pre_execute(self, queue_entry):
@@ -1494,7 +1493,6 @@ def query_collection_strategy(self, geometric_strategy):
14941493

14951494
tag = "recentring_mode"
14961495
result[tag] = RECENTRING_MODES.get(result.get(tag)) or default_recentring_mode
1497-
#
14981496
return result
14991497

15001498
def setup_data_collection(self, payload, correlation_id):
@@ -1867,7 +1865,6 @@ def setup_data_collection(self, payload, correlation_id):
18671865
+ ", ".join("%s:%s" % item for item in sorted(settings.items()))
18681866
)
18691867
goniostatTranslations.append(translation)
1870-
#
18711868
gphl_workflow_model.goniostat_translations = goniostatTranslations
18721869

18731870
# Do it here so that any centring actions are enqueued dfirst
@@ -1967,7 +1964,6 @@ def calculate_recentring(self, okp, ref_okp, ref_xyz):
19671964
"%s position %s recentred to above maximum limit %s"
19681965
% (tag, val, limit)
19691966
)
1970-
#
19711967
return result
19721968

19731969
def collect_data(self, payload, correlation_id):
@@ -2049,7 +2045,6 @@ def collect_data(self, payload, correlation_id):
20492045
acq_parameters.exp_time = scan.exposure.time
20502046
acq_parameters.num_passes = 1
20512047

2052-
##
20532048
wavelength = sweep.beamSetting.wavelength
20542049
acq_parameters.energy = HWR.beamline.energy.calculate_energy(wavelength)
20552050
detdistance = sweep.detectorSetting.axisSettings["Distance"]
@@ -2455,7 +2450,7 @@ def parse_indexing_solution(self, choose_lattice):
24552450

24562451
else:
24572452
raise RuntimeError("Indexing format %s not supported" % indexing_format)
2458-
#
2453+
24592454
return header, solutions_dict, select_row
24602455

24612456
def process_centring_request(self, payload, correlation_id):
@@ -2471,7 +2466,6 @@ def process_centring_request(self, payload, correlation_id):
24712466
# Rotate sample to RotationSetting
24722467
goniostatRotation = request_centring.goniostatRotation
24732468
goniostatTranslation = goniostatRotation.translation
2474-
#
24752469

24762470
if self._data_collection_group is None:
24772471
gphl_workflow_model = self._queue_entry.get_data_model()
@@ -2523,7 +2517,7 @@ def process_centring_request(self, payload, correlation_id):
25232517
return_status = "DONE"
25242518
else:
25252519
return_status = "NEXT"
2526-
#
2520+
25272521
return GphlMessages.CentringDone(
25282522
return_status,
25292523
timestamp=time.time(),
@@ -2651,7 +2645,7 @@ def obtain_prior_information(self, payload, correlation_id):
26512645
)
26522646

26532647
priorInformation = GphlMessages.PriorInformation(workflow_model, image_root)
2654-
#
2648+
26552649
return priorInformation
26562650

26572651
def handle_collection_end(
@@ -2746,7 +2740,6 @@ def resolution2dose_budget(
27462740
)
27472741
decay_limit = decay_limit or self.config.settings.get("decay_limit", 25)
27482742
result = 2 * resolution * resolution * math.log(100.0 / decay_limit)
2749-
#
27502743
return min(result, max_budget) / relative_rad_sensitivity
27512744

27522745
@staticmethod
@@ -2869,9 +2862,7 @@ def get_emulation_samples(self):
28692862
data[tag] = val
28702863
elif tag in dfp:
28712864
dfp[tag] = val
2872-
#
28732865
result.append(data)
2874-
#
28752866
return result
28762867

28772868
def get_emulation_sample_dir(self, sample_name=None):
@@ -2900,7 +2891,6 @@ def get_emulation_sample_dir(self, sample_name=None):
29002891
logging.getLogger("HWR").warning(
29012892
"No emulation sample dir found for sample %s", sample_name
29022893
)
2903-
#
29042894
return sample_dir
29052895

29062896
def get_emulation_crystal_data(self, sample_name=None):
@@ -2927,7 +2917,6 @@ def get_emulation_crystal_data(self, sample_name=None):
29272917
raise RuntimeError(
29282918
"No emulation data found for %s at %s " % (sample_name, sample_dir)
29292919
)
2930-
#
29312920
return crystal_data, hklfile
29322921

29332922
#
@@ -3037,7 +3026,6 @@ def update_lattice(self, values):
30373026
"point_groups": {"value": pgvalue, "enum": pglist},
30383027
"space_group": {"value": sgvalue, "enum": sgoptions},
30393028
}
3040-
#
30413029
return result
30423030

30433031
def update_point_groups(self, values):
@@ -3051,7 +3039,6 @@ def update_point_groups(self, values):
30513039
result = {
30523040
"space_group": {"value": value, "enum": sglist},
30533041
}
3054-
#
30553042
return result
30563043

30573044
def update_space_group(self, values):
@@ -3075,7 +3062,6 @@ def update_space_group(self, values):
30753062
point_groups = crystal_class[:-1]
30763063
if point_groups != point_groups0:
30773064
result["point_groups"]["value"] = point_groups
3078-
#
30793065
return result
30803066

30813067
def update_indexing_solution(self, values):
@@ -3094,7 +3080,6 @@ def update_indexing_solution(self, values):
30943080
break
30953081
else:
30963082
result = {}
3097-
#
30983083
return result
30993084

31003085
def adjust_dose(self, values):
@@ -3217,7 +3202,6 @@ def adjust_transmission(self, values):
32173202
dd0 = result.setdefault("use_dose", {})
32183203
dd0["highlight"] = "OK"
32193204
result["dose_budget"] = {"highlight": "OK"}
3220-
#
32213205
return result
32223206

32233207

mxcubecore/HardwareObjects/Gphl/GphlWorkflowConnection.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,13 @@ def get_executable(self, name):
181181
result = os.path.join(
182182
self.config.software_paths["GPHL_INSTALLATION"], "exe", name
183183
)
184-
#
185184
return result
186185

187186
def get_bdg_licence_dir(self, name):
188187
"""Get directory containing specific licence file (if any)
189188
for program called 'name'"""
190189
tag = "co.gphl.wf.%s.bdg_licence_dir" % name
191190
result = self.config.software_paths.get(tag)
192-
#
193191
return result
194192

195193
def open_connection(self):
@@ -337,7 +335,7 @@ def start_workflow(self, workflow_queue, workflow_model_obj):
337335
command_list.extend(
338336
conversion.command_option(keyword, value, quote_value=in_shell)
339337
)
340-
#
338+
341339
wdir = workflow_options.get("wdir")
342340
# NB this creates the appdir as well (wdir is within appdir)
343341
if not os.path.isdir(wdir):
@@ -660,7 +658,6 @@ def _decode_py4j_message(self, py4j_message):
660658
"Processing of GΦL message %s not implemented", message_type
661659
)
662660
payload = None
663-
#
664661
return GphlMessages.ParsedMessage(
665662
message_type, payload, enactment_id, correlation_id
666663
)
@@ -755,7 +752,6 @@ def __WorkflowDone_to_python(self, py4jWorkflowDone, cls):
755752
message = py4jIssue.getMessage()
756753
code = py4jIssue.getCode()
757754
issues.append(Issue(component=component, message=message, code=code))
758-
#
759755
return cls(issues=issues)
760756

761757
def _WorkflowCompleted_to_python(self, py4jWorkflowCompleted):
@@ -815,22 +811,19 @@ def _BeamstopSetting_to_python(self, py4jBeamstopSetting):
815811
return None
816812
uuidString = py4jBeamstopSetting.getId().toString()
817813
axisSettings = py4jBeamstopSetting.getAxisSettings()
818-
#
819814
return GphlMessages.BeamstopSetting(id_=uuid.UUID(uuidString), **axisSettings)
820815

821816
def _DetectorSetting_to_python(self, py4jDetectorSetting):
822817
if py4jDetectorSetting is None:
823818
return None
824819
uuidString = py4jDetectorSetting.getId().toString()
825820
axisSettings = py4jDetectorSetting.getAxisSettings()
826-
#
827821
return GphlMessages.DetectorSetting(id_=uuid.UUID(uuidString), **axisSettings)
828822

829823
def _BeamSetting_to_python(self, py4jBeamSetting):
830824
if py4jBeamSetting is None:
831825
return None
832826
uuidString = py4jBeamSetting.getId().toString()
833-
#
834827
return GphlMessages.BeamSetting(
835828
id_=uuid.UUID(uuidString), wavelength=py4jBeamSetting.getWavelength()
836829
)
@@ -997,7 +990,6 @@ def _PriorInformation_to_java(self, priorInformation):
997990
buildr = buildr.userProvidedInfo(
998991
self._UserProvidedInfo_to_java(priorInformation.userProvidedInfo)
999992
)
1000-
#
1001993
return buildr.build()
1002994

1003995
def _SampleCentred_to_java(self, sampleCentred):
@@ -1024,7 +1016,6 @@ def _SampleCentred_to_java(self, sampleCentred):
10241016
result.setGoniostatTranslations(
10251017
list(self._GoniostatTranslation_to_java(x) for x in translationSettings)
10261018
)
1027-
#
10281019
return result
10291020

10301021
def _CollectionDone_to_java(self, collectionDone):
@@ -1083,7 +1074,6 @@ def _SelectedLattice_to_java(self, selectedLattice):
10831074
)
10841075
elif urltpl:
10851076
builder = builder.referenceFile(urltpl.scheme, urltpl.path)
1086-
#
10871077
return builder.build()
10881078

10891079
def _IndexingSolution_to_java(self, indexingSolution):
@@ -1097,7 +1087,6 @@ def _IndexingSolution_to_java(self, indexingSolution):
10971087
indexingSolution.qualityOfFit,
10981088
cell,
10991089
)
1100-
#
11011090
return result
11021091

11031092
def _BeamlineAbort_to_java(self, beamlineAbort):

mxcubecore/HardwareObjects/Gphl/Transcal2MiniKappa.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def get_recen_data(transcal_file, instrumentation_file, diffractcal_file=None, *
8585
result["omega_axis"] = ll0[:3]
8686
result["kappa_axis"] = ll0[3:6]
8787
result["phi_axis"] = ll0[6:]
88-
#
8988
return result
9089

9190

@@ -144,7 +143,6 @@ def make_minikappa_data(
144143
# NB the signs of CSOC are set to get consistency with Gleb values
145144
kappa_position = (home - cross_sec_of_soc).tolist()
146145
phi_position = (home + cross_sec_of_soc).tolist()
147-
#
148146
return {
149147
"kappa_axis": kappa_axis,
150148
"phi_axis": phi_axis,

mxcubecore/HardwareObjects/LNLS/LNLSDiffractometer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ def _get_random_centring_position(self):
187187
if abs(val) > var_limit:
188188
val *= 1 - var_range / var_limit
189189
result[tag] = val
190-
#
191190
return result
192191

193192
def is_ready(self):

mxcubecore/HardwareObjects/MiniKappaCorrection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def rotation_matrix(self, axis, angle):
5050

5151
def alignVector(self, t1, t2, kappa, phi):
5252
x = np.array(t1) - np.array(t2) # rotating vector
53-
Rk = self.rotation_matrix(self.kappa, -kappa) #
54-
Rp = self.rotation_matrix(self.phi, -phi) #
53+
Rk = self.rotation_matrix(self.kappa, -kappa)
54+
Rp = self.rotation_matrix(self.phi, -phi)
5555
x = np.dot(Rp, np.dot(Rk, x)) / np.linalg.norm(
5656
x
5757
) # rotate backwards and normalize

0 commit comments

Comments
 (0)