def rowBefore(self,**_RowingVariablesDict): #Check that the TabularedCalibratedTable is ok if self.TabularedCalibratedTable!=None: #set the TabularedRowedPointer self.TabularedRowedPointer=self.TabularedCalibratedTable.row #Get the ModelingTuplesList ModelingTuplesList=self.ModelingDict[ SYS.getDoingStrWithDoStr(_RowingVariablesDict['RowingStr'])+'TuplesList' ] #Get the InsertingTuplesList self.TabularedRowedTuplesList=zip( SYS.unzip(ModelingTuplesList,[0]), self.pick(SYS.unzip(ModelingTuplesList,[0])) )
def joinBefore( self, **_JoiningVariablesDict ): #debug self.debug('Start of the method') #Alias JoiningModelStr=self.ModeledDict['JoiningModelStr'] #Table maybe the joined model if JoiningModelStr!="": #debug self.debug('We are tabling the joined model ?') #set a copy of it LastModeledDict=copy.copy(self.ModeledDict) #Get the joined ModeledDict self.ModeledDict=self['App_Model_'+SYS.getDoingStrWithDoStr(JoiningModelStr)+'Dict'] #debug self.debug( [ 'Check if we have to table', "self.ModeledDict!=None and ('IsTabledBool' not in self.ModeledDict or self.ModeledDict['IsTabledBool']==False) is "+str( self.ModeledDict!=None and ( 'IsTabledBool' not in self.ModeledDict or self.ModeledDict['IsTabledBool']==False)), ] ) #Check that we have to table if self.ModeledDict!=None and ( 'IsTabledBool' not in self.ModeledDict or self.ModeledDict['IsTabledBool']==False): #debug self.debug( [ 'We are going to table', "'IsTabledBool' not in self.ModeledDict' is "+str( 'IsTabledBool' not in self.ModeledDict) ] ) #Table self.table(JoiningModelStr) #debug self.debug('Ok this is tabled') #debug self.debug( [ 'The joined model is tabled ok', 'JoiningModelStr is '+str(JoiningModelStr) ] ) #Copy the ModeledDict JoinedModeledDict=copy.copy(self.ModeledDict) #Reset the ModeledDict to the original self.ModeledDict=LastModeledDict #set a link self.ModeledDict['JoinedModeledDict']=JoinedModeledDict #Check if JoinedModeledDict!={}: #debug self.debug('We are building the JoinedRetrievingIndexesList and give him the TabledInt') #set the JoinedRetrievingIndexesListKeyStr JoinedRetrievingIndexesListKeyStr=JoinedModeledDict['ModeledStr']+'RetrievingIndexesList' self.ModeledDict['JoinedRetrievingIndexesListKeyStr']=JoinedRetrievingIndexesListKeyStr #set in the ModeledDict self.ModeledDict['JoinedOrderedDict'][JoinedRetrievingIndexesListKeyStr]=[JoinedModeledDict['TabledInt'],-1] #debug self.debug("OK self.ModeledDict['JoinedOrderedDict' is so "+str( self.ModeledDict['JoinedOrderedDict'])) #debug self.debug('End of the method') #Return self return self
def model(self,_ModelStr="",**_DatabasingVariablesDict): """Call the Output<HookStr> methods and return self.OutputedPointer (self by default)""" #debug print('Modeler model method') print('_ModelStr is ',_ModelStr) print('') #Reinit attributes LocalOutputedPointer=self if _ModelStr=="": _ModelStr=self.DatabasedDict['ModelStr'] else: self.DatabasedDict=self['App_Model_'+SYS.getDoingStrWithDoStr(_ModelStr)+'Dict'] if self.DatabasedDict!=None: if 'IsDatabasedBool' not in self.DatabasedDict: #set variables IsDatabasedBool=False ModelStr=_ModelStr DatabasingStr=SYS.getDoingStrWithDoStr(ModelStr) DatabasedStr=SYS.getDoneStrWithDoStr(ModelStr) ModeledSuffixStr=SYS.getClassStrWithTypeStr(DatabasedStr+'Model') DatabasedKeyStr="" #Put them in the DatabasedDict LocalVars=vars() map( lambda __GettingStr: self.DatabasedDict.__setitem__(__GettingStr,LocalVars[__GettingStr]), [ 'IsDatabasedBool', 'ModelStr', 'DatabasingStr', 'DatabasedStr', 'ModeledSuffixStr', 'DatabasedKeyStr' ] ) #set IsDatabasingBool self.IsDatabasingBool=True #Hook methods for OrderStr in ["Before","After"]: #Definition the HookMethodStr HookingMethodStr='model'+OrderStr #Check that there is HookingMethods for it if HookingMethodStr in self.__class__.HookingMethodStrToMethodsListDict: #Call the specific Appended methods for HookingMethod in self.__class__.HookingMethodStrToMethodsListDict[HookingMethodStr]: #Call the HookMethod OutputVariable=HookingMethod(self,**_DatabasingVariablesDict) if type(OutputVariable)==dict: if 'LocalDatabasingVariablesDict' in OutputVariable: LocalDatabasingVariablesDict=OutputVariable['LocalDatabasingVariablesDict'] if 'LocalOutputedPointer' in OutputVariable: LocalOutputedPointer=OutputVariable['LocalOutputedPointer'] #Check Bool if self.IsDatabasingBool==False: return LocalOutputedPointer #debug print('END Modeler model method') print('_ModelStr is ',_ModelStr) print('') #Return the OutputVariable return LocalOutputedPointer