Beispiel #1
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
Beispiel #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
Beispiel #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")
Beispiel #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")
Beispiel #5
0
 def getFieldModelConfig(self):
     """ @rtype: FieldConfig """
     return FieldConfig.createCReference(EnkfConfigNode.cNamespace().get_ref(self), parent=self)
Beispiel #6
0
 def getFieldModelConfig(self):
     """ @rtype: FieldConfig """
     return FieldConfig.createCReference(
         EnkfConfigNode.cNamespace().get_ref(self), parent=self)