parameters: (self, ws, process)
docstring: Finalizes the reduction step by removing special values, calling merging functions and setting unique names
           to the output workspaces.
docstring_summary: Finalizes the reduction step by removing special values, calling merging functions and setting unique names
           to the output workspaces.
docstring_tokens: Finalizes the reduction step by removing special values calling merging functions and setting unique names to the output workspaces .
function: def _finalize(self, ws, process):
          """Finalizes the reduction step by removing special values, calling merging functions and setting unique names
           to the output workspaces."""
          output_treatment = self.getPropertyValue('OutputTreatment')
          if not (process == 'Vanadium' and output_treatment == 'Sum'):
              if output_treatment == 'AverageTwoTheta':
                  ws = self._merge_twoTheta_positions(ws)
              if output_treatment in ['AveragePol', 'Sum']:
                  self._merge_polarisations(ws, average_detectors=(output_treatment == 'AveragePol'))
                  if output_treatment == 'Sum':
                      self._merge_group_entries(ws)
              if self.getPropertyValue('MeasurementTechnique') == 'TOF' and process in ['Vanadium', 'Sample'] \
                      and self.getProperty('ConvertToEnergy').value:
                  self._rebin_in_energy(ws)
          elif output_treatment == 'Sum' and process != 'Vanadium':
              self._merge_group_entries(ws)
          ReplaceSpecialValues(InputWorkspace=ws, OutputWorkspace=ws, NaNValue=0,
                               NaNError=0, InfinityValue=0, InfinityError=0)
          mtd[ws][0].getRun().addProperty('ProcessedAs', process, True)
          if output_treatment == 'IndividualXY':
              self._merge_all_inputs(ws)
          RenameWorkspace(InputWorkspace=ws, OutputWorkspace=ws[2:])  # renames group as a whole
          ws = ws[2:]
          output_ws = self.getPropertyValue("OutputWorkspace")
          if mtd[ws].getNumberOfEntries() > 1:
              self._set_final_naming_scheme(ws, output_ws)
          self.setProperty('OutputWorkspace', mtd[ws])
function_tokens: def _finalize ( self , ws , process ) : output_treatment = self . getPropertyValue ( 'OutputTreatment' ) if not ( process == 'Vanadium' and output_treatment == 'Sum' ) : if output_treatment == 'AverageTwoTheta' : ws = self . _merge_twoTheta_positions ( ws ) if output_treatment in [ 'AveragePol' , 'Sum' ] : self . _merge_polarisations ( ws , average_detectors = ( output_treatment == 'AveragePol' ) ) if output_treatment == 'Sum' : self . _merge_group_entries ( ws ) if self . getPropertyValue ( 'MeasurementTechnique' ) == 'TOF' and process in [ 'Vanadium' , 'Sample' ] and self . getProperty ( 'ConvertToEnergy' ) . value : self . _rebin_in_energy ( ws ) elif output_treatment == 'Sum' and process != 'Vanadium' : self . _merge_group_entries ( ws ) ReplaceSpecialValues ( InputWorkspace = ws , OutputWorkspace = ws , NaNValue = 0 , NaNError = 0 , InfinityValue = 0 , InfinityError = 0 ) mtd [ ws ] [ 0 ] . getRun ( ) . addProperty ( 'ProcessedAs' , process , True ) if output_treatment == 'IndividualXY' : self . _merge_all_inputs ( ws ) RenameWorkspace ( InputWorkspace = ws , OutputWorkspace = ws [ 2 : ] ) # renames group as a whole ws = ws [ 2 : ] output_ws = self . getPropertyValue ( "OutputWorkspace" ) if mtd [ ws ] . getNumberOfEntries ( ) > 1 : self . _set_final_naming_scheme ( ws , output_ws ) self . setProperty ( 'OutputWorkspace' , mtd [ ws ] )