From d52a43a932033ea54a1960e1833fa7514d00ce89 Mon Sep 17 00:00:00 2001
From: Joseph Ramsay <joseph.ramsay@stfc.ac.uk>
Date: Tue, 26 Sep 2017 14:36:46 +0100
Subject: [PATCH] Re #20603 Added suffix option to POLARIS output

---
 scripts/Diffraction/isis_powder/polaris.py                  | 6 ++++++
 .../isis_powder/polaris_routines/polaris_param_mapping.py   | 1 +
 .../Diffraction/isis_powder/routines/instrument_settings.py | 1 +
 3 files changed, 8 insertions(+)

diff --git a/scripts/Diffraction/isis_powder/polaris.py b/scripts/Diffraction/isis_powder/polaris.py
index 995443610bc..66172962f71 100644
--- a/scripts/Diffraction/isis_powder/polaris.py
+++ b/scripts/Diffraction/isis_powder/polaris.py
@@ -88,8 +88,14 @@ class Polaris(AbstractInst):
                 use_new_name = True if int(run_number) >= first_run_new_name else False
 
             prefix = polaris_new_name if use_new_name else polaris_old_name
+
             return prefix + str(run_number)
 
+    def _generate_output_file_name(self, run_number_string):
+        suffix = self._inst_settings.suffix
+        suffix = "" if suffix is None else suffix
+        return Polaris._generate_input_file_name(run_number_string) + suffix
+
     def _get_input_batching_mode(self):
         return self._inst_settings.input_mode
 
diff --git a/scripts/Diffraction/isis_powder/polaris_routines/polaris_param_mapping.py b/scripts/Diffraction/isis_powder/polaris_routines/polaris_param_mapping.py
index 3ff98f3754a..7c370a88ed9 100644
--- a/scripts/Diffraction/isis_powder/polaris_routines/polaris_param_mapping.py
+++ b/scripts/Diffraction/isis_powder/polaris_routines/polaris_param_mapping.py
@@ -25,6 +25,7 @@ attr_mapping = \
      ParamMapEntry(ext_name="run_number",               int_name="run_number"),
      ParamMapEntry(ext_name="sample_empty",             int_name="sample_empty",   optional=True),
      ParamMapEntry(ext_name="sample_empty_scale",       int_name="sample_empty_scale"),
+     ParamMapEntry(ext_name="suffix",                   int_name="suffix", optional=True),
      ParamMapEntry(ext_name="spline_coefficient",       int_name="spline_coeff"),
      ParamMapEntry(ext_name="output_directory",         int_name="output_dir"),
      ParamMapEntry(ext_name="user_name",                int_name="user_name"),
diff --git a/scripts/Diffraction/isis_powder/routines/instrument_settings.py b/scripts/Diffraction/isis_powder/routines/instrument_settings.py
index d26ff4c13be..29497e36181 100644
--- a/scripts/Diffraction/isis_powder/routines/instrument_settings.py
+++ b/scripts/Diffraction/isis_powder/routines/instrument_settings.py
@@ -92,6 +92,7 @@ class InstrumentSettings(object):
             # Update attributes from said dictionary
             found_param_entry = next((param_entry for param_entry in self._param_map
                                       if config_key == param_entry.ext_name), None)
+
             if found_param_entry:
                 # Update the internal parameter entry
                 self._update_attribute(
-- 
GitLab