def do_find(self): #debug ''' self.debug( [ 'we are going to find', ("self.",self,[ 'FindingWhereVariable' ]) ] ) ''' #/###################/# # Case of mongo # #If the FoundMongoIsBool was not yet setted if self.FoundMongoIsBool==False: #debug ''' self.debug( [ 'FoundMongoRowDictsList was not yet setted' ] ) ''' #Check if self.ModelMongoBool: #find in the list self.FoundMongoRowDictsList=list( self.ModeledMongoCollection.find( self.FindingWhereVariable ) ) #set self.FoundMongoIsBool=True #debug ''' self.debug( [ ("self.",self,['FoundMongoRowDictsList']) ] ) ''' #/###################/# # Case of hdf # #If the FoundHdfIsBool was not yet setted if self.FoundHdfIsBool==False: #debug ''' self.debug( [ 'FoundHdfRowDictsList was not yet setted', ] ) ''' #Check if self.ModelHdfBool: #Take the first one in the list self.FoundHdfRowDictsList=Rower.getRowedDictsListWithTable( #self.TabularedHdfGroupVariable._f_getChild( # self.TabularedHdfKeyStrsList[0] #) self.ModeledHdfTable ) #set self.FoundHdfIsBool=True #debug ''' self.debug( [ ("self.",self,['FoundHdfRowDictsList']) ] ) ''' #Now we find with a condition Tuples list self.FoundHdfRowDictsList=SYS.filterNone( SYS.where( self.FoundHdfRowDictsList, self.FindingWhereVariable ) ) #debug ''' self.debug( [ 'The where is over now', ("self.",self,['FoundFilterRowDictsList']) ] ) ''' #/##################/# # Maybe recover # #Check if self.FindingRecoverBool: #Check if len(self.FoundMongoRowDictsList)==1: #get self.FoundRecoverDict=self.FoundMongoRowDictsList[0] elif len(self.FoundHdfRowDictsList)==1: #get self.FoundRecoverDict=self.FoundHdfRowDictsList[0] #debug ''' self.debug( [ 'Now we update with the self.RecoveredDict', 'self.RecoveredDict is '+str(self.RecoveredDict) ] ) ''' #set the RetrievingIndexesList and retrieve self.RetrievingIndexIntsList=[ 0, self.FoundRecoverDict['RowInt'] ] #debug ''' self.debug( [ ('self.',self,['RetrievingIndexIntsList']) ] ) ''' #Now we can retrieve self.retrieve()
def do_merge(self): #Check if self.ModelingHdfBool: #debug ''' self.debug( ('self.',self,[ 'ModeledKeyStr', 'MergingConditionVariable', 'TabularedTableKeyStrsList' ]) ) ''' #Debug ''' print( map( lambda __TabularedKeyStr: __TabularedKeyStr.split(Shaper.ShapingJoiningStr), self.TabularedTableKeyStrsList ) ) ''' #Bind with MergedShapingDictsList setting MergedShapingDictsList=map( lambda __StrsList: dict( map( lambda __ShapingStr: SYS.getUnSerializedTuple( self.NodePointDeriveNoder, __ShapingStr.split( Shaper.ShapingTuplingStr ) ) #Remove the suffix and the prefix ,__StrsList[1:-1] if len(__StrsList)>2 else [] ) ), map( lambda __TabularedKeyStr: __TabularedKeyStr.split(Shaper.ShapingJoiningStr), self.TabularedTableKeyStrsList ) ) #debug ''' self.debug('MergedShapingDictsList is '+str(MergedShapingDictsList)) ''' #Bind with MergedFilteredShapingDictsList MergedFilteredShapingDictsList=SYS.where( MergedShapingDictsList, self.MergingConditionVariable ) #debug ''' self.debug('MergedFilteredShapingDictsList is '+str(MergedFilteredShapingDictsList)) ''' #Bind with MergedTablesList setting MergedTablesList=SYS.filterNone( map( lambda __Table,__MergedFilteredShapingDict: __Table if __MergedFilteredShapingDict!=None else None, self.TabularedTablesOrderedDict.values(), MergedFilteredShapingDictsList )) MergedRowedDictsListsList=map( lambda __MergedTable: map( lambda __RowedDict: dict(__RowedDict,**{ 'TabledInt':int( __MergedTable.name.split(Tabler.TablingOrderStr)[1] ) } ), Rower.getRowedDictsListWithTable(__MergedTable) ), MergedTablesList ) #debug ''' self.debug('MergedRowedDictsListsList is '+str(MergedRowedDictsListsList)) ''' #Reduce if len(MergedRowedDictsListsList)>0: self.MergedRowedDictsList=reduce(operator.__add__,MergedRowedDictsListsList)