Exemple #1
0
    def on_actionAddToExperimentalData_triggered(self):
        '''
        Adds the currently displayed data and adds it to the experimental data.
        This is usually only useful if you want to want to use simulation results (which can then be perturbed)
        as input for other tools like parameter value estimation.
        '''
        logging.info("Adding current data to Experimental Data...")
        dataService = DataService()
        expDataSet = DataSet(None)
        expDataSet.setId("Pseudo-Experimental Data")
        expDataSet.setType(services.dataservice.EXPERIMENTAL)
        expDataSet.setSelected(True)
        first = True
        for key, list in self.data.items():
            for oldItem in list:
                item = oldItem.copy()

                if type(item.getId()) != str:
                    logging.debug(
                        "TableWidgetController.on_actionAddToExperimentalData_triggered(): Encountered item with non-string as id: %s. Skipping."
                        % str(item.getId()))
                    continue
                #                item.setId(item.getId() + "_syn")
                item.setType(datamanagement.entitydata.TYPE_EXPERIMENTAL)
                item.setAssociatedDataSet(expDataSet)
                expDataSet.data[
                    key] = item  # TODO: Handle mutliple EntityData objects correctly
                if first:
                    expDataSet.dataDescriptors = item.dataDescriptors[:]
                    expDataSet.dataDescriptorUnit = item.dataDescriptorUnit
                    first = False
        dataService.add_data(expDataSet)
Exemple #2
0
    def on_actionAddToExperimentalData_triggered(self):
        """
        Adds the currently displayed data and adds it to the experimental data.
        This is usually only useful if you want to want to use simulation results (which can then be perturbed)
        as input for other tools like parameter value estimation.
        """
        logging.info("Adding current data to Experimental Data...")
        dataService = DataService()
        expDataSet = DataSet(None)
        expDataSet.setId("Pseudo-Experimental Data")
        expDataSet.setType(services.dataservice.EXPERIMENTAL)
        expDataSet.setSelected(True)
        first = True
        for key, itemList in self.data.items():
            for oldItem in itemList:
                item = oldItem.copy()

                if type(item.getId()) != str:
                    logging.debug(
                        "TableWidgetController.on_actionAddToExperimentalData_triggered(): Encountered item with non-string as id: %s. Skipping."
                        % str(item.getId())
                    )
                    continue
                #                item.setId(item.getId() + "_syn")
                item.setType(datamanagement.entitydata.TYPE_EXPERIMENTAL)
                item.setAssociatedDataSet(expDataSet)
                expDataSet.data[key] = item  # TODO: Handle mutliple EntityData objects correctly
                if first:
                    expDataSet.dataDescriptors = item.dataDescriptors[:]
                    expDataSet.dataDescriptorUnit = item.dataDescriptorUnit
                    first = False
        dataService.add_data(expDataSet)