def getModelConfig(self): implementation_type = self.getImplementationType() if implementation_type == ErtImplType.FIELD: return self.getFieldModelConfig() elif implementation_type == ErtImplType.GEN_DATA: return self.getDataModelConfig() elif implementation_type == ErtImplType.GEN_KW: return self.getKeywordModelConfig() elif implementation_type == ErtImplType.SUMMARY: return SummaryConfig.createCReference( self.getPointerReference(), parent=self ) elif implementation_type == ErtImplType.EXT_PARAM: return ExtParamConfig.createCReference( self.getPointerReference(), parent=self ) else: print( ( "[EnkfConfigNode::getModelConfig()] " "Unhandled implementation model type: %i" ) % implementation_type )
def test_create(self): config = SummaryConfig("WWCT:OP_5") summary = Summary(config) self.assertEqual(len(summary), 0) with self.assertRaises(IndexError): v = summary[100]
def test_create(self): config = SummaryConfig("WWCT:OP_5") summary = Summary(config) self.assertEqual(len(summary), 0) with self.assertRaises(IndexError): v = summary[100] summary[0] = 75 self.assertEqual(summary[0], 75) summary[10] = 100 self.assertEqual(summary[10], 100) with self.assertRaises(ValueError): v5 = summary[5]
def getSummaryModelConfig(self): """@rtype: SummaryConfig""" return SummaryConfig.createCReference(self._get_ref(), parent=self)