当前位置: 首页>>代码示例>>Python>>正文


Python CWrapper.registerObjectType方法代码示例

本文整理汇总了Python中cwrap.CWrapper.registerObjectType方法的典型用法代码示例。如果您正苦于以下问题:Python CWrapper.registerObjectType方法的具体用法?Python CWrapper.registerObjectType怎么用?Python CWrapper.registerObjectType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cwrap.CWrapper的用法示例。


在下文中一共展示了CWrapper.registerObjectType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: realizationList

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
    def realizationList(self, state):
        """
        Will return list of realizations with state == the specified state.
        @type state: ert.enkf.enums.RealizationStateEnum
        @rtype: ert.util.IntVector
        """
        state_map = self.getStateMap()
        return state_map.realizationList(state)

    def getCustomKWConfigSet(self):
        """ @rtype: CustomKWConfigSet """
        return EnkfFs.cNamespace().config_kw_config_set(self)


cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("enkf_fs", EnkfFs)

EnkfFs.cNamespace().mount = cwrapper.prototype("c_void_p enkf_fs_mount(char* )")
EnkfFs.cNamespace().create = cwrapper.prototype("enkf_fs_ref enkf_fs_create_fs(char* , enkf_fs_type_enum , c_void_p , bool)")
EnkfFs.cNamespace().exists = cwrapper.prototype("bool enkf_fs_exists(char*)")
EnkfFs.cNamespace().disk_version = cwrapper.prototype("int enkf_fs_disk_version(char*)")
EnkfFs.cNamespace().update_disk_version = cwrapper.prototype("bool enkf_fs_update_disk_version(char*, int, int)")
EnkfFs.cNamespace().decref = cwrapper.prototype("int enkf_fs_decref(enkf_fs)")
EnkfFs.cNamespace().get_refcount = cwrapper.prototype("int enkf_fs_get_refcount(enkf_fs)")
EnkfFs.cNamespace().has_node = cwrapper.prototype("bool enkf_fs_has_node(enkf_fs, char*, c_uint, int, int, c_uint)")
EnkfFs.cNamespace().has_vector = cwrapper.prototype("bool enkf_fs_has_vector(enkf_fs, char*, c_uint, int, c_uint)")
EnkfFs.cNamespace().fread_node = cwrapper.prototype("void enkf_fs_fread_node(enkf_fs, buffer, char*, c_uint, int, int, c_uint)")
EnkfFs.cNamespace().fread_vector = cwrapper.prototype("void enkf_fs_fread_vector(enkf_fs, buffer, char*, c_uint, int, c_uint)")
EnkfFs.cNamespace().get_time_map = cwrapper.prototype("time_map_ref enkf_fs_get_time_map(enkf_fs)")
EnkfFs.cNamespace().get_state_map = cwrapper.prototype("state_map_ref enkf_fs_get_state_map(enkf_fs)")
EnkfFs.cNamespace().get_case_name = cwrapper.prototype("char* enkf_fs_get_case_name(enkf_fs)")
开发者ID:agchitu,项目名称:ert,代码行数:33,代码来源:enkf_fs.py

示例2: __len__

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
        return SummaryKeyMatcher.cNamespace().add_key(self, key)

    def __len__(self):
        return SummaryKeyMatcher.cNamespace().size(self)

    def __contains__(self, key):
        return SummaryKeyMatcher.cNamespace().match_key(self, key)

    def isRequired(self, key):
        """ @rtype: bool """
        return SummaryKeyMatcher.cNamespace().is_required(self, key)

    def keys(self):
        """ @rtype: StringList """
        return SummaryKeyMatcher.cNamespace().keys(self)

    def free(self):
        SummaryKeyMatcher.cNamespace().free(self)


cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("summary_key_matcher", SummaryKeyMatcher)

SummaryKeyMatcher.cNamespace().alloc  = cwrapper.prototype("c_void_p summary_key_matcher_alloc()")
SummaryKeyMatcher.cNamespace().free  = cwrapper.prototype("void summary_key_matcher_free(summary_key_matcher)")
SummaryKeyMatcher.cNamespace().size  = cwrapper.prototype("int summary_key_matcher_get_size(summary_key_matcher)")
SummaryKeyMatcher.cNamespace().add_key  = cwrapper.prototype("void summary_key_matcher_add_summary_key(summary_key_matcher, char*)")
SummaryKeyMatcher.cNamespace().match_key  = cwrapper.prototype("bool summary_key_matcher_match_summary_key(summary_key_matcher, char*)")
SummaryKeyMatcher.cNamespace().keys  = cwrapper.prototype("stringlist_obj summary_key_matcher_get_keys(summary_key_matcher)")
SummaryKeyMatcher.cNamespace().is_required  = cwrapper.prototype("bool summary_key_matcher_summary_key_is_required(summary_key_matcher, char*)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:summary_key_matcher.py

示例3: length

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
        return WellSegment.cNamespace().depth(self)

    def length(self):
        """ @rtype: float """
        return WellSegment.cNamespace().length(self)

    def totalLength(self):
        """ @rtype: float """
        return WellSegment.cNamespace().total_length(self)

    def diameter(self):
        """ @rtype: float """
        return WellSegment.cNamespace().diameter(self)


CWrapper.registerObjectType("well_segment", WellSegment)
cwrapper = CWrapper(ECL_WELL_LIB)


WellSegment.cNamespace().active = cwrapper.prototype("bool well_segment_active(well_segment)")
WellSegment.cNamespace().main_stem = cwrapper.prototype("bool well_segment_main_stem(well_segment)")
WellSegment.cNamespace().nearest_wellhead = cwrapper.prototype("bool well_segment_nearest_wellhead(well_segment)")

WellSegment.cNamespace().id = cwrapper.prototype("int well_segment_get_id(well_segment)")
WellSegment.cNamespace().link_count = cwrapper.prototype("int well_segment_get_link_count(well_segment)")
WellSegment.cNamespace().branch_id = cwrapper.prototype("int well_segment_get_branch_id(well_segment)")
WellSegment.cNamespace().outlet_id = cwrapper.prototype("int well_segment_get_outlet_id(well_segment)")

WellSegment.cNamespace().depth = cwrapper.prototype("double well_segment_get_depth(well_segment)")
WellSegment.cNamespace().length = cwrapper.prototype("double well_segment_get_length(well_segment)")
WellSegment.cNamespace().total_length = cwrapper.prototype("double well_segment_get_total_length(well_segment)")
开发者ID:agchitu,项目名称:ert,代码行数:33,代码来源:well_segment.py

示例4: KeyError

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
        config = self.getConfig()

        if not key in config:
            raise KeyError("The key: '%s' is not available!" % key)

        if isinstance(value, (float, int, long)):
            CustomKW.cNamespace().set_double(self, key, value)
        else:
            CustomKW.cNamespace().set_string(self, key, str(value))


    def getConfig(self):
        """ @rtype: CustomKWConfig """
        return CustomKW.cNamespace().get_config(self)

    def free(self):
       CustomKW.cNamespace().free(self)

cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("custom_kw", CustomKW)

CustomKW.cNamespace().free = cwrapper.prototype("void custom_kw_free(custom_kw)")
CustomKW.cNamespace().alloc = cwrapper.prototype("void* custom_kw_alloc(custom_kw_config)")
CustomKW.cNamespace().fload = cwrapper.prototype("bool custom_kw_fload(custom_kw, char*)")
CustomKW.cNamespace().get_config = cwrapper.prototype("custom_kw_config_ref custom_kw_get_config(custom_kw)")
CustomKW.cNamespace().key_is_null = cwrapper.prototype("bool custom_kw_key_is_null(custom_kw, char*)")
CustomKW.cNamespace().iget_as_double = cwrapper.prototype("double custom_kw_iget_as_double(custom_kw, int)")
CustomKW.cNamespace().iget_as_string = cwrapper.prototype("char* custom_kw_iget_as_string(custom_kw, int)")
CustomKW.cNamespace().set_string = cwrapper.prototype("void custom_kw_set_string(custom_kw, char*, char*)")
CustomKW.cNamespace().set_double = cwrapper.prototype("void custom_kw_set_double(custom_kw, char*, double)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:custom_kw.py

示例5: convertDefinition

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
    @classmethod
    def convertDefinition(cls, definition):
        """ @rtype: IntegerHash """
        type_hash = IntegerHash()

        for key, value_type in definition.iteritems():
            if value_type == float:
                value_type = 1
            else:
                value_type = 0 #str
            type_hash[key] = value_type
        return type_hash



cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("custom_kw_config", CustomKWConfig)

CustomKWConfig.cNamespace().free = cwrapper.prototype("void custom_kw_config_free(custom_kw_config)")
CustomKWConfig.cNamespace().alloc_empty = cwrapper.prototype("void* custom_kw_config_alloc_empty(char*, char*, char*)")
CustomKWConfig.cNamespace().alloc_with_definition = cwrapper.prototype("void* custom_kw_config_alloc_with_definition(char*, integer_hash)")
CustomKWConfig.cNamespace().get_name = cwrapper.prototype("char* custom_kw_config_get_name(custom_kw_config)")
CustomKWConfig.cNamespace().get_result_file = cwrapper.prototype("char* custom_kw_config_get_result_file(custom_kw_config)")
CustomKWConfig.cNamespace().get_output_file = cwrapper.prototype("char* custom_kw_config_get_output_file(custom_kw_config)")
CustomKWConfig.cNamespace().parse_result_file = cwrapper.prototype("bool custom_kw_config_parse_result_file(custom_kw_config, char*, stringlist)")
CustomKWConfig.cNamespace().has_key = cwrapper.prototype("bool custom_kw_config_has_key(custom_kw_config, char*)")
CustomKWConfig.cNamespace().key_is_double = cwrapper.prototype("bool custom_kw_config_key_is_double(custom_kw_config, char*)")
CustomKWConfig.cNamespace().index_of_key = cwrapper.prototype("int custom_kw_config_index_of_key(custom_kw_config, char*)")
CustomKWConfig.cNamespace().size = cwrapper.prototype("int custom_kw_config_size(custom_kw_config)")
CustomKWConfig.cNamespace().keys = cwrapper.prototype("stringlist_obj custom_kw_config_get_keys(custom_kw_config)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:custom_kw_config.py

示例6: scale

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
    def scale(self, S, E=None, D=None, R=None, D_obs=None):
        assert isinstance(S, Matrix)
        assert isinstance(E, (Matrix, NoneType))
        assert isinstance(D, (Matrix, NoneType))
        assert isinstance(R, (Matrix, NoneType))
        assert isinstance(D_obs, (Matrix, NoneType))
        ObsData.cNamespace().scale(self, S, E, D, R, D_obs)


    def free(self):
        ObsData.cNamespace().free(self)



cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("obs_data", ObsData)

ObsData.cNamespace().alloc       = cwrapper.prototype("c_void_p obs_data_alloc(double)")
ObsData.cNamespace().free        = cwrapper.prototype("void obs_data_free(obs_data)")
ObsData.cNamespace().total_size  = cwrapper.prototype("int obs_data_get_total_size(obs_data)")
ObsData.cNamespace().iget_value  = cwrapper.prototype("double obs_data_iget_value(obs_data)")
ObsData.cNamespace().iget_std  = cwrapper.prototype("double obs_data_iget_std(obs_data)")
ObsData.cNamespace().add_block   = cwrapper.prototype("obs_block_ref obs_data_add_block(obs_data , char* , int , matrix , bool)")

ObsData.cNamespace().allocdObs   = cwrapper.prototype("matrix_obj obs_data_allocdObs(obs_data)")
ObsData.cNamespace().allocR      = cwrapper.prototype("matrix_obj obs_data_allocR(obs_data)")
ObsData.cNamespace().allocD      = cwrapper.prototype("matrix_obj obs_data_allocD(obs_data , matrix , matrix)")
ObsData.cNamespace().allocE      = cwrapper.prototype("matrix_obj obs_data_allocE(obs_data , rng , int)")
ObsData.cNamespace().scale       = cwrapper.prototype("void obs_data_scale(obs_data, matrix, matrix, matrix, matrix, matrix)")
ObsData.cNamespace().scale_matrix = cwrapper.prototype("void obs_data_scale_matrix(obs_data, matrix)")
ObsData.cNamespace().scale_Rmatrix = cwrapper.prototype("void obs_data_scale_Rmatrix(obs_data, matrix)")
开发者ID:agchitu,项目名称:ert,代码行数:33,代码来源:obs_data.py

示例7: getParentLayer

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
            
        self.cNamespace().get_neighbours( self , connected_only , polylines , neighbour_id_list )

        parent_layer = self.getParentLayer()
        neighbour_list = []
        for id in neighbour_id_list:
            neighbour_list.append( parent_layer.getBlock( id ))
        return neighbour_list
        

    def getParentLayer(self):
        return self.parent()
        


cwrapper = CWrapper(ECL_LIB)
CWrapper.registerObjectType("fault_block", FaultBlock)

FaultBlock.cNamespace().get_xc                = cwrapper.prototype("double                fault_block_get_xc(fault_block)")
FaultBlock.cNamespace().get_yc                = cwrapper.prototype("double                fault_block_get_yc(fault_block)")
FaultBlock.cNamespace().get_block_id          = cwrapper.prototype("int                   fault_block_get_id(fault_block)")
FaultBlock.cNamespace().get_size              = cwrapper.prototype("int                   fault_block_get_size(fault_block)")
FaultBlock.cNamespace().export_cell           = cwrapper.prototype("void                  fault_block_export_cell(fault_block , int , int* , int* , int* , double* , double* , double*)")
FaultBlock.cNamespace().assign_to_region      = cwrapper.prototype("void                  fault_block_assign_to_region(fault_block , int)")
FaultBlock.cNamespace().get_region_list       = cwrapper.prototype("int_vector_ref        fault_block_get_region_list(fault_block)")
FaultBlock.cNamespace().add_cell              = cwrapper.prototype("void                  fault_block_add_cell(fault_block,  int , int)")
FaultBlock.cNamespace().get_global_index_list = cwrapper.prototype("int_vector_ref        fault_block_get_global_index_list(fault_block)")
FaultBlock.cNamespace().trace_edge            = cwrapper.prototype("void                  fault_block_trace_edge( fault_block, double_vector , double_vector , int_vector)")  
FaultBlock.cNamespace().get_neighbours        = cwrapper.prototype("void                  fault_block_list_neighbours( fault_block , bool , geo_polygon_collection , int_vector)")  

开发者ID:agchitu,项目名称:ert,代码行数:31,代码来源:fault_block.py

示例8: ActiveList

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
from cwrap import BaseCClass, CWrapper
from ert.enkf import ENKF_LIB

class ActiveList(BaseCClass):
    def __init__(self):
        c_ptr = ActiveList.cNamespace().alloc()
        super(ActiveList, self).__init__(c_ptr)


    def getMode(self):
        return ActiveList.cNamespace().get_mode(self)

    def addActiveIndex(self, index):
        ActiveList.cNamespace().add_index(self , index)

        
    def free(self):
        ActiveList.cNamespace().free(self)



cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("active_list", ActiveList)


ActiveList.cNamespace().alloc     = cwrapper.prototype("c_void_p active_list_alloc()")
ActiveList.cNamespace().free      = cwrapper.prototype("void     active_list_free(active_list)")
ActiveList.cNamespace().get_mode  = cwrapper.prototype("active_mode_enum active_list_get_mode(active_list)")
ActiveList.cNamespace().add_index = cwrapper.prototype("void active_list_add_index(active_list , int)")
开发者ID:agchitu,项目名称:ert,代码行数:31,代码来源:active_list.py

示例9: CWrapper

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
        """Will return a list of report_step, simulation time and days.

        The return value will be a list tuples. For a unified restart
        file with the three report steps {10,15,20} it can look like:

           [  (10, datetime.datetime( 2010 , 1 , 1 , 0 , 0 , 0 ) , 100.0),
              (15, datetime.datetime( 2010 , 3 , 1 , 0 , 0 , 0 ) , 160.0),
              (20, datetime.datetime( 2010 , 5 , 1 , 0 , 0 , 0 ) , 220.0) ]

        For a non-unified restart file the list will have only one element.
        """

        self.assertHeaders()
        time_list = []
        for header in self.rst_headers:
            time_list.append( (header.getReportStep() , header.getSimDate( ) , header.getSimDays( )) )

        return time_list

    

            
CWrapper.registerObjectType("ecl_rsthead", EclRestartHead)
cwrapper = CWrapper(ECL_LIB)
EclRestartHead.cNamespace().alloc           = cwrapper.prototype("c_void_p ecl_rsthead_alloc(ecl_file_view , int )")
EclRestartHead.cNamespace().alloc_from_kw   = cwrapper.prototype("c_void_p ecl_rsthead_alloc_from_kw(int , ecl_kw , ecl_kw , ecl_kw )")
EclRestartHead.cNamespace().free            = cwrapper.prototype("void ecl_rsthead_free(ecl_rsthead)")
EclRestartHead.cNamespace().get_report_step = cwrapper.prototype("int ecl_rsthead_get_report_step(ecl_rsthead)")
EclRestartHead.cNamespace().get_sim_time    = cwrapper.prototype("time_t ecl_rsthead_get_sim_time(ecl_rsthead)")
EclRestartHead.cNamespace().get_sim_days    = cwrapper.prototype("double ecl_rsthead_get_sim_days(ecl_rsthead)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:ecl_restart_file.py

示例10: namespace

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
import ert
from cwrap import CWrapper, BaseCClass, CWrapError
from ert.test  import ExtendedTestCase

test_lib  = ert.load("libert_util") # create a local namespace (so we don't overwrite StringList)
cwrapper =  CWrapper(test_lib)

class StringListTest(BaseCClass):
    def __init__(self):
        c_pointer = self.cNamespace().alloc()
        super(StringListTest, self).__init__(c_pointer)

    def free(self):
        StringListTest.cNamespace().free(self)

CWrapper.registerObjectType("stringlisttest", StringListTest)

StringListTest.cNamespace().alloc = cwrapper.prototype("c_void_p stringlist_alloc_new( )")
StringListTest.cNamespace().free  = cwrapper.prototype("void stringlist_free(stringlisttest )")


class CWrapTest(ExtendedTestCase):

    def test_return_type(self):
        stringlist_alloc = cwrapper.prototype("c_void_p stringlist_alloc_new( )")
        string_list1 = StringListTest()

        stringlist_alloc = cwrapper.prototype("stringlisttest_obj stringlist_alloc_new( )")
        string_list2 = stringlist_alloc()

        stringlist_alloc = cwrapper.prototype("stringlisttest_ref stringlist_alloc_new( )")
开发者ID:agchitu,项目名称:ert,代码行数:33,代码来源:test_cwrap.py

示例11: branches

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]


    # def branches(self):
    #     """ @rtype: BranchCollection """

    def isMultiSegmentWell(self):
        """ @rtype: bool """
        return WellState.cNamespace().is_msw(self)

    def hasSegmentData(self):
        """ @rtype: bool """
        return WellState.cNamespace().has_segment_data(self)


CWrapper.registerObjectType("well_state", WellState)
cwrapper = CWrapper(ECL_WELL_LIB)


WellState.cNamespace().get_name = cwrapper.prototype("char* well_state_get_name(well_state)")
WellState.cNamespace().is_open = cwrapper.prototype("bool well_state_is_open(well_state)")
WellState.cNamespace().is_msw = cwrapper.prototype("bool well_state_is_MSW(well_state)")
WellState.cNamespace().well_number = cwrapper.prototype("int well_state_get_well_nr(well_state)")
WellState.cNamespace().report_number = cwrapper.prototype("int well_state_get_report_nr(well_state)")
WellState.cNamespace().sim_time = cwrapper.prototype("time_t well_state_get_sim_time(well_state)")
WellState.cNamespace().well_type = cwrapper.prototype("well_type_enum well_state_get_type(well_state)")
WellState.cNamespace().has_segment_data = cwrapper.prototype("bool well_state_has_segment_data(well_state)")

WellState.cNamespace().has_global_connections = cwrapper.prototype("bool well_state_has_global_connections(well_state)")
WellState.cNamespace().get_global_connections = cwrapper.prototype("c_void_p well_state_get_global_connections(well_state)")
WellState.cNamespace().global_connections_size = cwrapper.prototype("int well_conn_collection_get_size(c_void_p)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:well_state.py

示例12: igetMean

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
    def igetMean(self , iobs):
        if 0 <= iobs < self.getObsSize():
            return MeasBlock.cNamespace().iget_mean(self , iobs)
        else:
            raise IndexError("Invalid observation index:%d  valid range: [0,%d)" % (iobs , self.getObsSize()))

    def igetStd(self , iobs):
        if 0 <= iobs < self.getObsSize():
            return MeasBlock.cNamespace().iget_std(self , iobs)
        else:
            raise IndexError("Invalid observation index:%d  valid range: [0,%d)" % (iobs , self.getObsSize()))



cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("meas_block", MeasBlock)

MeasBlock.cNamespace().alloc = cwrapper.prototype("c_void_p meas_block_alloc( char* , bool_vector , int)")
MeasBlock.cNamespace().free = cwrapper.prototype("void meas_block_free( meas_block )")
MeasBlock.cNamespace().get_active_ens_size = cwrapper.prototype("int meas_block_get_active_ens_size( meas_block )")
MeasBlock.cNamespace().get_total_ens_size = cwrapper.prototype("int meas_block_get_total_ens_size( meas_block )")
MeasBlock.cNamespace().get_total_obs_size = cwrapper.prototype("int meas_block_get_total_obs_size( meas_block )")
MeasBlock.cNamespace().iget_value = cwrapper.prototype("double meas_block_iget( meas_block , int , int)")
MeasBlock.cNamespace().iset_value = cwrapper.prototype("void meas_block_iset( meas_block , int , int , double)")
MeasBlock.cNamespace().iget_mean = cwrapper.prototype("double meas_block_iget_ens_mean( meas_block , int )")
MeasBlock.cNamespace().iget_std = cwrapper.prototype("double meas_block_iget_ens_std( meas_block , int )")
MeasBlock.cNamespace().iens_active = cwrapper.prototype("bool meas_block_iens_active( meas_block , int )")


    
开发者ID:agchitu,项目名称:ert,代码行数:29,代码来源:meas_block.py

示例13: __exit__

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]

    def __exit__(self, exc_type, exc_val, exc_tb):
        del self.__test_context
        return False


    def getErt(self):
        return self.__test_context.getErt()


    def getCwd(self):
        """
        Returns the current working directory of this context.
        @rtype: string
        """
        return self.__test_context.getCwd()




cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("ert_test", ErtTest)

ErtTest.cNamespace().alloc = cwrapper.prototype("c_void_p ert_test_context_alloc_python( char* , char*)")
ErtTest.cNamespace().set_store = cwrapper.prototype("c_void_p ert_test_context_set_store( ert_test , bool)")
ErtTest.cNamespace().free = cwrapper.prototype("void ert_test_context_free( ert_test )")
ErtTest.cNamespace().get_enkf_main = cwrapper.prototype("enkf_main_ref ert_test_context_get_main( ert_test )")
ErtTest.cNamespace().get_cwd = cwrapper.prototype("char* ert_test_context_get_cwd( ert_test )")

开发者ID:agchitu,项目名称:ert,代码行数:30,代码来源:ert_test_context.py

示例14: getStoredConfigKeys

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
    def getStoredConfigKeys(self):
        """ @rtype: StringList """
        return CustomKWConfigSet.cNamespace().get_keys(self)

    def updateConfig(self, config):
        """ @type config: CustomKWConfig """
        CustomKWConfigSet.cNamespace().update_config(self, config)

    def fwrite(self, filename):
        """ @type filename: str """
        CustomKWConfigSet.cNamespace().fwrite(self, filename)

    def reset(self):
        CustomKWConfigSet.cNamespace().reset(self)

    def free(self):
        CustomKWConfigSet.cNamespace().free(self)


cwrapper = CWrapper(ENKF_LIB)
cwrapper.registerObjectType("custom_kw_config_set", CustomKWConfigSet)

CustomKWConfigSet.cNamespace().alloc  = cwrapper.prototype("c_void_p custom_kw_config_set_alloc()")
CustomKWConfigSet.cNamespace().alloc_from_file  = cwrapper.prototype("c_void_p custom_kw_config_set_alloc_from_file(char*)")
CustomKWConfigSet.cNamespace().free  = cwrapper.prototype("void custom_kw_config_set_free(custom_kw_config_set)")
CustomKWConfigSet.cNamespace().reset  = cwrapper.prototype("void custom_kw_config_set_reset(custom_kw_config_set)")
CustomKWConfigSet.cNamespace().add_config  = cwrapper.prototype("void custom_kw_config_set_add_config(custom_kw_config_set, custom_kw_config)")
CustomKWConfigSet.cNamespace().update_config  = cwrapper.prototype("void custom_kw_config_set_update_config(custom_kw_config_set, custom_kw_config)")
CustomKWConfigSet.cNamespace().get_keys  = cwrapper.prototype("stringlist_obj custom_kw_config_set_get_keys_alloc(custom_kw_config_set)")
CustomKWConfigSet.cNamespace().fwrite  = cwrapper.prototype("void custom_kw_config_set_fwrite(custom_kw_config_set, char*)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:custom_kw_config_set.py

示例15: TypeError

# 需要导入模块: from cwrap import CWrapper [as 别名]
# 或者: from cwrap.CWrapper import registerObjectType [as 别名]
        else:
            raise TypeError("Index should be integer type")


    def getLayer(self , k):
        """
        @rtype: FaultBlockLayer
        """
        return self[k]

    def free(self):
        self.cNamespace().free(self)


    def scanKeyword(self , fault_block_kw):
        ok = self.cNamespace().scan_keyword( self , fault_block_kw )
        if not ok:
            raise ValueError("The fault block keyword had wrong type/size")

    

cwrapper = CWrapper(ECL_LIB)
CWrapper.registerObjectType("fault_block_collection", FaultBlockCollection)


FaultBlockCollection.cNamespace().alloc      = cwrapper.prototype("c_void_p         fault_block_collection_alloc(ecl_grid )")
FaultBlockCollection.cNamespace().free       = cwrapper.prototype("void             fault_block_collection_free(fault_block_collection)")
FaultBlockCollection.cNamespace().num_layers = cwrapper.prototype("int              fault_block_collection_num_layers(fault_block_collection)")
FaultBlockCollection.cNamespace().get_layer  = cwrapper.prototype("fault_block_layer_ref  fault_block_collection_get_layer(fault_block_collection, int)")
FaultBlockCollection.cNamespace().scan_keyword  = cwrapper.prototype("bool          fault_block_collection_scan_kw(fault_block_collection, ecl_kw)")
开发者ID:agchitu,项目名称:ert,代码行数:32,代码来源:fault_block_collection.py


注:本文中的cwrap.CWrapper.registerObjectType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。