Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(17)  |  Call(17)  |  Derive(0)  |  Import(0)

src/a/z/AZOrange-HEAD/azorange/AZutilities/getCinfonyDesc.py   AZOrange(Download)
    if len(results) > 1:
        for res in results[1:]:
            resData = dataUtilities.horizontalMerge(resData, res, smilesName, smilesName)
    data = dataUtilities.horizontalMerge(data, resData, smilesName, smilesName)
    # Revert the SMILES back to it's original state

src/a/z/AZOrange-HEAD/orange/OrangeWidgets/Data/OWMergeData.py   AZOrange(Download)
    def sendData(self):
        """Sends out data.
        """
        if self.varA and self.varB:
            etAB = dataUtilities.horizontalMerge(self.dataA,self.dataB,self.varA,self.varB)
            self.send("Merged Examples A+B", etAB)
 
            etBA = dataUtilities.horizontalMerge(self.dataB,self.dataA,self.varB,self.varA)

src/a/z/AZOrange-HEAD/tests/source/AZdataUtilitiesTest.py   AZOrange(Download)
 
 
        res = dataUtilities.horizontalMerge(data1, data2, mergeAttrName1, mergeAttrName2)
        testD = dataUtilities.DataTable(os.path.join(AZOC.AZORANGEHOME,"tests/source/data/mergeTestsData/D1p2.tab"))
        for idx,ex in enumerate(testD):
            for attr in res[idx].domain:
                self.assertEqual(res[idx][attr.name],ex[attr.name],"D1p2: Example " + str(idx) + " Attr "+attr.name+" value do not match:"+str(res[idx][attr.name])+" != "+str(ex[attr.name]))
 
        res = dataUtilities.horizontalMerge(data2, data1, mergeAttrName2, mergeAttrName1)
        self.assert_(data1.domain.classVar.name != data2.domain.classVar.name,"D1 and D2 should have different classes in order to perform the test")         
        #Test Both with Class -> Class should be the same as data1
        res = dataUtilities.horizontalMerge(data1, data2, mergeAttrName1, mergeAttrName2)
        self.assertEqual(res.domain.classVar.name,data1.domain.classVar.name,"Wrong Class var. Got: "+str(res.domain.classVar.name)+" Expected: "+str(data1.domain.classVar.name))
 
        #Test data2 classless -> Class should be the same as data1
        data2NoClass = orange.ExampleTable(orange.Domain(data2.domain,None),data2)
        self.assertEqual(data2NoClass.domain.classVar,None,"Data should not have class")
        res = dataUtilities.horizontalMerge(data1, data2NoClass, mergeAttrName1, mergeAttrName2)
        self.assertEqual(res.domain.classVar.name,data1.domain.classVar.name,"Wrong Class var")
        #Test now with different order od datasets
        res = dataUtilities.horizontalMerge(data2NoClass, data1, mergeAttrName2, mergeAttrName1)
        self.assertEqual(res.domain.classVar.name,data1.domain.classVar.name,"Wrong Class var")