Example #1
0
 def _readMoreXML(self, xmlNode):
     """
   Function to read the portion of the xml input that belongs to this specialized class
   and initialize some stuff based on the inputs got
   @ In, xmlNode, xml.etree.ElementTree.Element, Xml element node
   @ Out, None
 """
     Assembler._readMoreXML(self, xmlNode)
     self._readMoreXMLbase(xmlNode)
     self.localInputAndChecks(xmlNode)
Example #2
0
 def _readMoreXML(self, xmlNode):
     """
   Function to read the portion of the xml input that belongs to this specialized class
   and initialize some stuff based on the inputs got
   @ In, xmlNode, xml.etree.ElementTree.Element, Xml element node
   @ Out, None
 """
     # TODO can be combined with Sampler's _readMoreXML, but needs to implement paramInput passing to localInputAndChecks (new input checker)
     Assembler._readMoreXML(self, xmlNode)
     self._readMoreXMLbase(xmlNode)
     self.localInputAndChecks(xmlNode)
Example #3
0
 def _readMoreXML(self, xmlNode):
     """
   Function to read the portion of the xml input that belongs to this specialized class
   and initialize some stuff based on the inputs got
   The text is supposed to contain the info where and which variable to change.
   In case of a code the syntax is specified by the code interface itself
   @ In, xmlNode, xml.etree.ElementTree.Element, Xml element node
   @ Out, None
 """
     Assembler._readMoreXML(self, xmlNode)
     self._readMoreXMLbase(xmlNode)
     self.localInputAndChecks(xmlNode)
Example #4
0
 def _readMoreXML(self,xmlNode):
   """
     Function to read the portion of the xml input that belongs to this specialized class
     and initialize some stuff based on the inputs got
     @ In, xmlNode, xml.etree.ElementTree.Element, Xml element node
     @ Out, None
   """
   Assembler._readMoreXML(self,xmlNode)
   try:
     self.subType = xmlNode.attrib['subType']
   except KeyError:
     self.raiseADebug("Failed in Node: "+str(xmlNode),verbostiy='silent')
     self.raiseAnError(IOError,'missed subType for the model '+self.name)
   for child in xmlNode:
     if child.tag =='alias':
       # the input would be <alias variable='internal_variable_name'>Material|Fuel|thermal_conductivity</alias>
       if 'variable' in child.attrib.keys():
         if 'type' in child.attrib.keys():
           if child.attrib['type'].lower() not in ['input','output']:
             self.raiseAnError(IOError,'the type of alias can be either "input" or "output". Got '+child.attrib['type'].lower())
           aliasType           = child.attrib['type'].lower().strip()
           complementAliasType = 'output' if aliasType == 'input' else 'input'
         else:
           self.raiseAnError(IOError,'not found the attribute "type" in the definition of one of the alias for model '+str(self.name) +' of type '+self.type)
         varFramework, varModel = child.attrib['variable'], child.text.strip()
         if varFramework in self.alias[aliasType].keys():
           self.raiseAnError(IOError,' The alias for variable ' +varFramework+' has been already inputted in model '+str(self.name) +' of type '+self.type)
         if varModel in self.alias[aliasType].values():
           self.raiseAnError(IOError,' The alias ' +varModel+' has been already used for another variable in model '+str(self.name) +' of type '+self.type)
         if varFramework in self.alias[complementAliasType].keys():
           self.raiseAnError(IOError,' The alias for variable ' +varFramework+' has been already inputted ('+complementAliasType+') in model '+str(self.name) +' of type '+self.type)
         if varModel in self.alias[complementAliasType].values():
           self.raiseAnError(IOError,' The alias ' +varModel+' has been already used ('+complementAliasType+') for another variable in model '+str(self.name) +' of type '+self.type)
         self.alias[aliasType][varFramework] = child.text.strip()
       else:
         self.raiseAnError(IOError,'not found the attribute "variable" in the definition of one of the alias for model '+str(self.name) +' of type '+self.type)
   # read local information
   self.localInputAndChecks(xmlNode)