Skip to content

Commit

Permalink
check all tests pass (#121)
Browse files Browse the repository at this point in the history
* fix pre-commit erroneous errors

Signed-off-by: Jose Borreguero <[email protected]>

* ignore flake8 error

Signed-off-by: Jose Borreguero <[email protected]>

* fix test

Signed-off-by: Jose Borreguero <[email protected]>

* remove DEBUG temporary changes

Signed-off-by: Jose Borreguero <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Jose Borreguero <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jmborr and pre-commit-ci[bot] authored Apr 27, 2024
1 parent 57cdd67 commit afa1750
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
34 changes: 18 additions & 16 deletions RefRed/sf_calculator/reduction_sf_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,22 +205,24 @@ def generate_script(
script += "from lr_reduction.scaling_factors import LRScalingFactors\n"
script += "from lr_reduction.utils import mantid_algorithm_exec\n\n"

script += "mantid_algorithm_exec(\n"
script += " LRScalingFactors.LRScalingFactors,\n"
script += f" DirectBeamRuns={run_list},\n"
script += f" IncidentMedium='{incident_medium}',\n"
script += f" TOFRange={tof_range},\n"
script += f" TOFSteps={self.sf_gui.deadtime_tof_step},\n"
script += f" SignalPeakPixelRange={peak_ranges},\n"
script += f" SignalBackgroundPixelRange={bck_ranges},\n"
script += f" LowResolutionPixelRange={low_res_ranges},\n"
script += f" ScalingFactorFile='{output_file_name}',\n"
script += f" UseDeadTimeCorrection={self.sf_gui.apply_deadtime},\n"
script += f" ParalyzableDeadTime={self.sf_gui.paralyzable_deadtime},\n"
script += f" DeadTime={self.sf_gui.deadtime_value},\n"
script += f" DeadTimeTOFStep={self.sf_gui.deadtime_tof_step},\n"
script += ")\n"

mantid_call = [
r"mantid_algorithm_exec(",
r" LRScalingFactors.LRScalingFactors,",
r" DirectBeamRuns={0},".format(run_list),
r" IncidentMedium='{0}',".format(incident_medium),
r" TOFRange={0},".format(tof_range),
r" TOFSteps={0},".format(self.sf_gui.deadtime_tof_step),
r" SignalPeakPixelRange={0},".format(peak_ranges),
r" SignalBackgroundPixelRange={0},".format(bck_ranges),
r" LowResolutionPixelRange={0},".format(low_res_ranges),
r" ScalingFactorFile='{0}',".format(output_file_name),
r" UseDeadTimeCorrection={0},".format(self.sf_gui.apply_deadtime),
r" ParalyzableDeadTime={0},".format(self.sf_gui.paralyzable_deadtime),
r" DeadTime={0},".format(self.sf_gui.deadtime_value),
r" DeadTimeTOFStep={0},".format(self.sf_gui.deadtime_tof_step),
r")",
]
script += "\n".join(mantid_call) + "\n"
return script

def refreshOutputFileContainPreview(self, output_file_name):
Expand Down
4 changes: 2 additions & 2 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def directory(self):
def path_to(self, basename):
r"""Absolute path to a data file"""
file_path = os.path.join(self._directory, basename)
if not os.path.isfile(file_path):
raise IOError(f'File {basename} not found in data directory {self._directory}')
if os.path.isfile(file_path) is False:
raise FileNotFoundError(f"File {basename} not found in data directory {self._directory}") # noqa E713
return file_path

yield _DataServe()
Expand Down

1 comment on commit afa1750

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitLab pipeline for refred-dev has been submitted for this commit: "https://code.ornl.gov/sns-hfir-scse/deployments/conda-legacy-deploy/-/pipelines/559481"

Please sign in to comment.