def export(self , filename , file_type = None , init_file = None): output_transform = False if file_type is None: try: file_type = FieldConfig.exportFormat( filename ) except ValueError: sys.stderr.write("Sorry - could not infer output format from filename:%s\n" % filename) return False Field.cNamespace().export(self , filename , None , file_type , output_transform , init_file ) return True
def export(self, filename, file_type=None, init_file=None): output_transform = False if file_type is None: try: file_type = FieldConfig.exportFormat(filename) except ValueError: sys.stderr.write( "Sorry - could not infer output format from filename:%s\n" % filename) return False Field.cNamespace().export(self, filename, None, file_type, output_transform, init_file) return True
def test_export_format(self): self.assertEqual( FieldConfig.exportFormat("file.grdecl") , EnkfFieldFileFormatEnum.ECL_GRDECL_FILE ) self.assertEqual( FieldConfig.exportFormat("file.roFF") , EnkfFieldFileFormatEnum.RMS_ROFF_FILE ) with self.assertRaises(ValueError): FieldConfig.exportFormat("file.xyz") with self.assertRaises(ValueError): FieldConfig.exportFormat("file.xyz")
def test_export_format(self): self.assertEqual(FieldConfig.exportFormat("file.grdecl"), EnkfFieldFileFormatEnum.ECL_GRDECL_FILE) self.assertEqual(FieldConfig.exportFormat("file.roFF"), EnkfFieldFileFormatEnum.RMS_ROFF_FILE) with self.assertRaises(ValueError): FieldConfig.exportFormat("file.xyz") with self.assertRaises(ValueError): FieldConfig.exportFormat("file.xyz")
def getFieldModelConfig(self): """ @rtype: FieldConfig """ return FieldConfig.createCReference(EnkfConfigNode.cNamespace().get_ref(self), parent=self)
def getFieldModelConfig(self): """ @rtype: FieldConfig """ return FieldConfig.createCReference( EnkfConfigNode.cNamespace().get_ref(self), parent=self)