Ejemplo n.º 1
0
class ProjectReaderMantidPlot(ProjectReaderInterface):
    def __init__(self, project_file_ext, filename):
        super().__init__(project_file_ext, filename)
        self.parser = None

    def read_project(self):
        try:
            self.parser = MantidPlotProjectParser(self.filename)
            self.read_workspaces()
            self.read_interfaces()
            self.read_plots()
        except Exception as err:
            logger.warning("Mantidplot project file unable to be loaded/read",
                           err)

    def read_workspaces(self):
        logger.notice("Loading workspaces from Mantidplot project file " +
                      self.filename)
        self.workspace_names = self.parser.get_workspaces()

    def read_interfaces(self):
        logger.notice(
            "Loading interfaces from mantid plot project file not supported")

    def read_plots(self):
        logger.notice("Loading plots from MantidPlot project file")
        self.plot_list = self.parser.get_plots()
Ejemplo n.º 2
0
    def test_parsing_workspace_group(self):
        expected_workspaces = [
            'MUSR00015189_1', 'MUSR00015189_2', 'MUSR00062260', 'MUSR00062261'
        ]
        parser = MantidPlotProjectParser(self.project_with_workspace_group)

        workspace_list = parser.get_workspaces()

        self.assertCountEqual(workspace_list, expected_workspaces)
Ejemplo n.º 3
0
    def test_parsing_workspaces(self):
        expected_workspaces = [
            'BASIS_79827_divided_sqw', 'irs26176_graphite002_red',
            'MUSR00062261'
        ]
        parser = MantidPlotProjectParser(self.project_with_multiple_workspaces)

        workspace_list = parser.get_workspaces()

        self.assertCountEqual(workspace_list, expected_workspaces)