parameters: (donor: Union[str, Workspace2D], numSpec, numPeaks)
return_statement: return output
docstring: The resulting workspace needs to be added to the ADS
docstring_summary: The resulting workspace needs to be added to the ADS
docstring_tokens: The resulting workspace needs to be added to the ADS
function: def __create_outputws(donor: Union[str, Workspace2D], numSpec, numPeaks):
      '''The resulting workspace needs to be added to the ADS'''
      # convert the d-space table to a Workspace2d
      if donor:
          donor = mtd[str(donor)]
      else:
          donor = 'Workspace2D'
      output = WorkspaceFactory.create(donor, NVectors=numSpec,
                                       XLength=numPeaks, YLength=numPeaks)
      output.getAxis(0).setUnit('dSpacing')
      return output
function_tokens: def __create_outputws ( donor : Union [ str , Workspace2D ] , numSpec , numPeaks ) : # convert the d-space table to a Workspace2d if donor : donor = mtd [ str ( donor ) ] else : donor = 'Workspace2D' output = WorkspaceFactory . create ( donor , NVectors = numSpec , XLength = numPeaks , YLength = numPeaks ) output . getAxis ( 0 ) . setUnit ( 'dSpacing' ) return output