Skip to content

Commit

Permalink
address lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
glass-ships committed Dec 19, 2024
1 parent 4e137d0 commit ab800eb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/drtsans/auto_wedge.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ def _export_to_h5(iq2d, rings, azimuthal_delta, peak_fit_dict, output_dir):
function_data_set[0] = peak_fit_dict[index]["fit_function"]

# add peak fitting result
for param_name in func_param_dict:
for param_name, param_value in func_param_dict.items():
# form data set
data_set = np.array(func_param_dict[param_name])
data_set = np.array(param_value)
fit_group.create_dataset(param_name, data=data_set)

# close
Expand Down
8 changes: 4 additions & 4 deletions src/drtsans/pixel_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1766,14 +1766,14 @@ def as_intensities(input_workspace, component="detector1", views=["positions", "
intensities = np.zeros(number_histograms)

returned_views = {}
for cal_prop in pixel_props: # 'positions', 'heights', 'widths', 'positions_mantid'
output_workspace = f"{str(input_workspace)}_{cal_prop}" # Workspace containing the property as intensity
for cal_prop_key, cal_prop_val in pixel_props.items(): # 'positions', 'heights', 'widths', 'positions_mantid'
output_workspace = f"{str(input_workspace)}_{cal_prop_key}" # Workspace containing the property as intensity
# intensties will be non-zero only for workpace indexes that have associated pixels of interests
intensities[workspace_indexes] = pixel_props[cal_prop]
intensities[workspace_indexes] = cal_prop_val
workspace = Integration(InputWorkspace=input_workspace, OutputWorkspace=output_workspace)
for index in range(number_histograms):
workspace.dataY(index)[:] = intensities[index]
returned_views[cal_prop] = mtd[output_workspace]
returned_views[cal_prop_key] = mtd[output_workspace]

return returned_views

Expand Down
2 changes: 1 addition & 1 deletion src/drtsans/sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def mask_pixels_with_nan(sensitivity_workspace):
)

# mask the "bad" pixels
temp_sensitivity = MaskDetectorsIf(
temp_sensitivity = MaskDetectorsIf( # noqa: F841
InputWorkspace=sensitivity_workspace,
Operator="GreaterEqual",
Value=BAD_PIXEL,
Expand Down
5 changes: 3 additions & 2 deletions src/drtsans/tof/eqsans/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ def source_aperture(other, unit="m"):

# Find the appropriate set of slit diameters
run_number = int(sample_logs.run_number.value)
for start, end in index_to_diameters:
for key, val in index_to_diameters.items():
start, end = key
if start <= run_number <= end:
index_to_diameter = index_to_diameters[(start, end)]
index_to_diameter = val
break

# entries vBeamSlit, vBeamSlit2, and vBeamSlit3 contain the slit number, identifying the slit diameter
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/drtsans/mono/test_spice_xml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def test_get_das_logs(datarepo_dir, clean_workspace):
LoadHFIRSANS(Filename=test_xml, OutputWorkspace=clean_workspace("SpiceXMLTest"))
spice_ws = mtd["SpiceXMLTest"]

for das_log_name in das_log_values:
log_value, log_unit = das_log_values[das_log_name]
for das_log_name, das_log_value in das_log_values:
log_value, log_unit = das_log_value
print(f"{das_log_name}: {log_value}, {log_unit}")
if das_log_name in ["sample_detector_distance", "wavelength_spread"]:
continue
Expand Down

0 comments on commit ab800eb

Please sign in to comment.