How to use the ecl.util.monkey_the_camel function in ecl

To help you get started, we’ve selected a few ecl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OPM / ResInsight / ThirdParty / Ert / python / python / ecl / ecl / faults / fault_block.py View on Github external
neighbour_list = []
        for id in neighbour_id_list:
            neighbour_list.append(parent_layer.getBlock(id))
        return neighbour_list


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


monkey_the_camel(FaultBlock, 'getCentroid', FaultBlock.get_centroid)
monkey_the_camel(FaultBlock, 'countInside', FaultBlock.count_inside)
monkey_the_camel(FaultBlock, 'getBlockID', FaultBlock.get_block_id)
monkey_the_camel(FaultBlock, 'assignToRegion', FaultBlock.assign_to_region)
monkey_the_camel(FaultBlock, 'getRegionList', FaultBlock.get_region_list)
monkey_the_camel(FaultBlock, 'addCell', FaultBlock.add_cell)
monkey_the_camel(FaultBlock, 'getGlobalIndexList', FaultBlock.get_global_index_list)
monkey_the_camel(FaultBlock, 'getEdgePolygon', FaultBlock.get_edge_polygon)
monkey_the_camel(FaultBlock, 'containsPolyline', FaultBlock.contains_polyline)
monkey_the_camel(FaultBlock, 'getNeighbours', FaultBlock.get_neighbours)
monkey_the_camel(FaultBlock, 'getParentLayer', FaultBlock.get_parent_layer)
github OPM / ResInsight / ThirdParty / Ert / python / python / ecl / ecl / ecl_npv.py View on Github external
npv += %s
varDict[\"npv\"] = npv
""" % parsedExpression



    def eval_npv(self):
        byteCode = compile(self.code, "", 'exec')
        varDict = {}
        eval(byteCode)
        return varDict["npv"]



monkey_the_camel(NPVPriceVector, 'addItem', NPVPriceVector.add_item)
monkey_the_camel(NPVPriceVector, 'assertDate', NPVPriceVector.assert_date, staticmethod)
monkey_the_camel(NPVPriceVector, 'evalDate', NPVPriceVector.eval_date)

monkey_the_camel(EclNPV, 'getExpression', EclNPV.get_expression)
monkey_the_camel(EclNPV, 'setExpression', EclNPV.set_expression)
monkey_the_camel(EclNPV, 'getKeyList', EclNPV.get_key_list)
monkey_the_camel(EclNPV, 'addKey', EclNPV.add_key)
monkey_the_camel(EclNPV, 'parseExpression', EclNPV.parse_expression)
monkey_the_camel(EclNPV, 'evalNPV', EclNPV.eval_npv)
github OPM / ResInsight / ThirdParty / Ert / python / python / ecl / ecl / ecl_rft.py View on Github external
rft = self._get_rft( well_name , CTime( date ))
        rft.setParent( self )
        return rft

    def free(self):
        self._free( )

    def __repr__(self):
        w = len(self)
        return self._create_repr('wells = %d' % w)


monkey_the_camel(EclRFT, 'getWellName', EclRFT.get_well_name)
monkey_the_camel(EclRFT, 'getDate', EclRFT.get_date)

monkey_the_camel(EclRFTFile, 'getNumWells', EclRFTFile.get_num_wells)
monkey_the_camel(EclRFTFile, 'getHeaders', EclRFTFile.get_headers)
github OPM / ResInsight / ThirdParty / Ert / python / python / ecl / ecl / faults / fault_block_layer.py View on Github external
return self._get_layer()


    def cell_contact(self, p1, p2):
        layer = self.getGeoLayer()
        return layer.cellContact(p1,p2)

monkey_the_camel(FaultBlockLayer, 'scanKeyword', FaultBlockLayer.scan_keyword)
monkey_the_camel(FaultBlockLayer, 'loadKeyword', FaultBlockLayer.load_keyword)
monkey_the_camel(FaultBlockLayer, 'getBlock', FaultBlockLayer.get_block)
monkey_the_camel(FaultBlockLayer, 'deleteBlock', FaultBlockLayer.delete_block)
monkey_the_camel(FaultBlockLayer, 'addBlock', FaultBlockLayer.add_block)
monkey_the_camel(FaultBlockLayer, 'getNextID', FaultBlockLayer.get_next_id)
monkey_the_camel(FaultBlockLayer, 'getK', FaultBlockLayer.get_k)
monkey_the_camel(FaultBlockLayer, 'scanLayer', FaultBlockLayer.scan_layer)
monkey_the_camel(FaultBlockLayer, 'insertBlockContent', FaultBlockLayer.insert_block_content)
monkey_the_camel(FaultBlockLayer, 'exportKeyword', FaultBlockLayer.export_keyword)
monkey_the_camel(FaultBlockLayer, 'addFaultBarrier', FaultBlockLayer.add_fault_barrier)
monkey_the_camel(FaultBlockLayer, 'addFaultLink', FaultBlockLayer.add_fault_link)
monkey_the_camel(FaultBlockLayer, 'joinFaults', FaultBlockLayer.join_faults)
monkey_the_camel(FaultBlockLayer, 'addPolylineBarrier', FaultBlockLayer.add_polyline_barrier)
monkey_the_camel(FaultBlockLayer, 'getGeoLayer', FaultBlockLayer.get_geo_layer)
monkey_the_camel(FaultBlockLayer, 'cellContact', FaultBlockLayer.cell_contact)
github OPM / ResInsight / ThirdParty / Ert / python / python / ecl / ecl / faults / fault_block_layer.py View on Github external
c0 = c1


    def get_geo_layer(self):
        """Returns the underlying geometric layer."""
        return self._get_layer()


    def cell_contact(self, p1, p2):
        layer = self.getGeoLayer()
        return layer.cellContact(p1,p2)

monkey_the_camel(FaultBlockLayer, 'scanKeyword', FaultBlockLayer.scan_keyword)
monkey_the_camel(FaultBlockLayer, 'loadKeyword', FaultBlockLayer.load_keyword)
monkey_the_camel(FaultBlockLayer, 'getBlock', FaultBlockLayer.get_block)
monkey_the_camel(FaultBlockLayer, 'deleteBlock', FaultBlockLayer.delete_block)
monkey_the_camel(FaultBlockLayer, 'addBlock', FaultBlockLayer.add_block)
monkey_the_camel(FaultBlockLayer, 'getNextID', FaultBlockLayer.get_next_id)
monkey_the_camel(FaultBlockLayer, 'getK', FaultBlockLayer.get_k)
monkey_the_camel(FaultBlockLayer, 'scanLayer', FaultBlockLayer.scan_layer)
monkey_the_camel(FaultBlockLayer, 'insertBlockContent', FaultBlockLayer.insert_block_content)
monkey_the_camel(FaultBlockLayer, 'exportKeyword', FaultBlockLayer.export_keyword)
monkey_the_camel(FaultBlockLayer, 'addFaultBarrier', FaultBlockLayer.add_fault_barrier)
monkey_the_camel(FaultBlockLayer, 'addFaultLink', FaultBlockLayer.add_fault_link)
monkey_the_camel(FaultBlockLayer, 'joinFaults', FaultBlockLayer.join_faults)
monkey_the_camel(FaultBlockLayer, 'addPolylineBarrier', FaultBlockLayer.add_polyline_barrier)
monkey_the_camel(FaultBlockLayer, 'getGeoLayer', FaultBlockLayer.get_geo_layer)
monkey_the_camel(FaultBlockLayer, 'cellContact', FaultBlockLayer.cell_contact)
github OPM / ResInsight / ThirdParty / Ert / python / python / ecl / ecl / ecl_3dkw.py View on Github external
return (self.grid.getNX() , self.grid.getNY() , self.grid.getNZ())


    def set_default(self, default_value):
        self.default_value = default_value


    def get_default(self):
        return self.default_value


monkey_the_camel(Ecl3DKW, 'castFromKW', Ecl3DKW.cast_from_kw, classmethod)
monkey_the_camel(Ecl3DKW, 'compressedCopy', Ecl3DKW.compressed_copy)
monkey_the_camel(Ecl3DKW, 'globalCopy', Ecl3DKW.global_copy)
monkey_the_camel(Ecl3DKW, 'setDefault', Ecl3DKW.set_default)
monkey_the_camel(Ecl3DKW, 'getDefault', Ecl3DKW.get_default)
github OPM / ResInsight / ThirdParty / Ert / python / python / ecl / ecl / faults / layer.py View on Github external
monkey_the_camel(Layer, 'activeCell', Layer.active_cell)
monkey_the_camel(Layer, 'updateActive', Layer.update_active)
monkey_the_camel(Layer, 'bottomBarrier', Layer.bottom_barrier)
monkey_the_camel(Layer, 'leftBarrier', Layer.left_barrier)
monkey_the_camel(Layer, 'getNX', Layer.get_nx)
monkey_the_camel(Layer, 'getNY', Layer.get_ny)
monkey_the_camel(Layer, 'cellContact', Layer.cell_contact)
monkey_the_camel(Layer, 'addInterpBarrier', Layer.add_interp_barrier)
monkey_the_camel(Layer, 'addPolylineBarrier', Layer.add_polyline_barrier)
monkey_the_camel(Layer, 'addFaultBarrier', Layer.add_fault_barrier)
monkey_the_camel(Layer, 'addIJBarrier', Layer.add_ij_barrier)
monkey_the_camel(Layer, 'cellSum', Layer.cell_sum)
monkey_the_camel(Layer, 'clearCells', Layer.clear_cells)
monkey_the_camel(Layer, 'updateConnected', Layer.update_connected)
monkey_the_camel(Layer, 'cellsEqual', Layer.cells_equal)
monkey_the_camel(Layer, 'countEqual', Layer.count_equal)
github OPM / ResInsight / ThirdParty / Ert / python / python / ecl / ecl / faults / fault_block.py View on Github external
for id in neighbour_id_list:
            neighbour_list.append(parent_layer.getBlock(id))
        return neighbour_list


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


monkey_the_camel(FaultBlock, 'getCentroid', FaultBlock.get_centroid)
monkey_the_camel(FaultBlock, 'countInside', FaultBlock.count_inside)
monkey_the_camel(FaultBlock, 'getBlockID', FaultBlock.get_block_id)
monkey_the_camel(FaultBlock, 'assignToRegion', FaultBlock.assign_to_region)
monkey_the_camel(FaultBlock, 'getRegionList', FaultBlock.get_region_list)
monkey_the_camel(FaultBlock, 'addCell', FaultBlock.add_cell)
monkey_the_camel(FaultBlock, 'getGlobalIndexList', FaultBlock.get_global_index_list)
monkey_the_camel(FaultBlock, 'getEdgePolygon', FaultBlock.get_edge_polygon)
monkey_the_camel(FaultBlock, 'containsPolyline', FaultBlock.contains_polyline)
monkey_the_camel(FaultBlock, 'getNeighbours', FaultBlock.get_neighbours)
monkey_the_camel(FaultBlock, 'getParentLayer', FaultBlock.get_parent_layer)
github OPM / ResInsight / ThirdParty / Ert / python / python / ecl / ecl / ecl_cmp.py View on Github external
Will return a list of summary keys in the test case.
        """
        return self.test_case.keys()


    def test_wells(self):
        """
        Will return a list of wells keys in the test case.
        """
        return self.test_case.wells()



monkey_the_camel(EclCase, 'loadSummary', EclCase.load_summary)
monkey_the_camel(EclCase, 'startTimeEqual', EclCase.start_time_equal)
monkey_the_camel(EclCase, 'endTimeEqual', EclCase.end_time_equal)
monkey_the_camel(EclCase, 'cmpSummaryVector', EclCase.cmp_summary_vector)

monkey_the_camel(EclCmp, 'initCheck', EclCmp.init_check)
monkey_the_camel(EclCmp, 'hasSummaryVector', EclCmp.has_summary_vector)
monkey_the_camel(EclCmp, 'endTimeEqual', EclCmp.end_time_equal)
monkey_the_camel(EclCmp, 'cmpSummaryVector', EclCmp.cmp_summary_vector)
monkey_the_camel(EclCmp, 'testKeys', EclCmp.test_keys)
monkey_the_camel(EclCmp, 'testWells', EclCmp.test_wells)
github OPM / ResInsight / ThirdParty / Ert / python / python / ecl / ecl / ecl_npv.py View on Github external
for i in range(len(trange) - 1):
   npv += %s
varDict[\"npv\"] = npv
""" % parsedExpression



    def eval_npv(self):
        byteCode = compile(self.code, "", 'exec')
        varDict = {}
        eval(byteCode)
        return varDict["npv"]



monkey_the_camel(NPVPriceVector, 'addItem', NPVPriceVector.add_item)
monkey_the_camel(NPVPriceVector, 'assertDate', NPVPriceVector.assert_date, staticmethod)
monkey_the_camel(NPVPriceVector, 'evalDate', NPVPriceVector.eval_date)

monkey_the_camel(EclNPV, 'getExpression', EclNPV.get_expression)
monkey_the_camel(EclNPV, 'setExpression', EclNPV.set_expression)
monkey_the_camel(EclNPV, 'getKeyList', EclNPV.get_key_list)
monkey_the_camel(EclNPV, 'addKey', EclNPV.add_key)
monkey_the_camel(EclNPV, 'parseExpression', EclNPV.parse_expression)
monkey_the_camel(EclNPV, 'evalNPV', EclNPV.eval_npv)