Esempio n. 1
0
File: field.py Progetto: akva2/ert
    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
Esempio n. 2
0
    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
Esempio n. 3
0
    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")
Esempio n. 4
0
    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")
Esempio n. 5
0
 def getFieldModelConfig(self):
     """ @rtype: FieldConfig """
     return FieldConfig.createCReference(EnkfConfigNode.cNamespace().get_ref(self), parent=self)
Esempio n. 6
0
 def getFieldModelConfig(self):
     """ @rtype: FieldConfig """
     return FieldConfig.createCReference(
         EnkfConfigNode.cNamespace().get_ref(self), parent=self)