How to use the ecl.util.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 / ecl / summary / ecl_sum.py View on Github external
import ecl.summary.ecl_sum_keyword_vector
EclSum._dump_csv_line = EclPrototype("void ecl_sum_fwrite_interp_csv_line(ecl_sum, time_t, ecl_sum_vector, FILE)", bind=False)
EclSum._get_interp_vector = EclPrototype("void ecl_sum_get_interp_vector(ecl_sum, time_t, ecl_sum_vector, double_vector)", bind=False)
EclSum._init_pandas_frame = EclPrototype("void ecl_sum_init_double_frame(ecl_sum, ecl_sum_vector, double*)", bind=False)
EclSum._init_pandas_frame_interp = EclPrototype("void ecl_sum_init_double_frame_interp(ecl_sum, ecl_sum_vector, time_t_vector, double*)", bind=False)

monkey_the_camel(EclSum, 'varType', EclSum.var_type, classmethod)
monkey_the_camel(EclSum, 'addVariable', EclSum.add_variable)
monkey_the_camel(EclSum, 'addTStep', EclSum.add_t_step)
monkey_the_camel(EclSum, 'assertKeyValid', EclSum.assert_key_valid)
monkey_the_camel(EclSum, 'scaleVector', EclSum.scale_vector)
monkey_the_camel(EclSum, 'shiftVector', EclSum.shift_vector)
monkey_the_camel(EclSum, 'timeRange', EclSum.time_range)
monkey_the_camel(EclSum, 'blockedProduction', EclSum.blocked_production)
monkey_the_camel(EclSum, 'getDataStartTime', EclSum.get_data_start_time)
monkey_the_camel(EclSum, 'getStartTime', EclSum.get_start_time)
monkey_the_camel(EclSum, 'getEndTime', EclSum.get_end_time)
monkey_the_camel(EclSum, 'solveDates', EclSum.solve_dates)
monkey_the_camel(EclSum, 'solveDays', EclSum.solve_days)
monkey_the_camel(EclSum, 'dumpCSVLine', EclSum.dump_csv_line)
monkey_the_camel(EclSum, 'exportCSV', EclSum.export_csv)
github equinor / libecl / python / ecl / grid / ecl_grid.py View on Github external
return None

        return self._export_mapaxes()

    @property
    def unit_system(self):
        return self._get_unit_system()

monkey_the_camel(EclGrid, 'loadFromGrdecl', EclGrid.load_from_grdecl, classmethod)
monkey_the_camel(EclGrid, 'loadFromFile', EclGrid.load_from_file, classmethod)
monkey_the_camel(EclGrid, 'createRectangular', EclGrid.create_rectangular, classmethod)
monkey_the_camel(EclGrid, 'dualGrid', EclGrid.dual_grid)
monkey_the_camel(EclGrid, 'getDims', EclGrid.get_dims)
monkey_the_camel(EclGrid, 'getNX', EclGrid.get_nx)
monkey_the_camel(EclGrid, 'getNY', EclGrid.get_ny)
monkey_the_camel(EclGrid, 'getNZ', EclGrid.get_nz)
monkey_the_camel(EclGrid, 'getGlobalSize', EclGrid.get_global_size)
monkey_the_camel(EclGrid, 'getNumActive', EclGrid.get_num_active)
monkey_the_camel(EclGrid, 'getNumActiveFracture', EclGrid.get_num_active_fracture)
monkey_the_camel(EclGrid, 'getBoundingBox2D', EclGrid.get_bounding_box_2d)
monkey_the_camel(EclGrid, 'getName', EclGrid.get_name)
monkey_the_camel(EclGrid, 'validCellGeometry', EclGrid.valid_cell_geometry)
monkey_the_camel(EclGrid, 'getNodePos', EclGrid.get_node_pos)
monkey_the_camel(EclGrid, 'getCellCorner', EclGrid.get_cell_corner)
monkey_the_camel(EclGrid, 'getNodeXYZ', EclGrid.get_node_xyz)
monkey_the_camel(EclGrid, 'getLayerXYZ', EclGrid.get_layer_xyz)
monkey_the_camel(EclGrid, 'findCellXY', EclGrid.find_cell_xy)
monkey_the_camel(EclGrid, 'findCellCornerXY', EclGrid.find_cell_corner_xy)
monkey_the_camel(EclGrid, 'getCellDims', EclGrid.get_cell_dims)
monkey_the_camel(EclGrid, 'getNumLGR', EclGrid.get_num_lgr)
monkey_the_camel(EclGrid, 'createKW', EclGrid.create_kw)
monkey_the_camel(EclGrid, 'create3D', EclGrid.create_3d)
github equinor / libecl / python / ecl / grid / faults / fault_line.py View on Github external
def end_point(self):
        pl = self.getPolyline()
        return pl[-1]

    def dump(self):
        print('-----------------------------------------------------------------')
        for segment in self:
            C1 = segment.getC1()
            C2 = segment.getC2()
            (J1, I1) = divmod(C1, self.__grid.getNX() + 1)
            (J2, I2) = divmod(C2, self.__grid.getNX() + 1)
            print('[Corner:%5d IJ:(%3d,%d)] -> [Corner:%5d IJ:(%3d,%d)]'
                  % (C1, I1, J1, C2, I2, J2))


monkey_the_camel(FaultLine, 'tryAppend', FaultLine.try_append)
monkey_the_camel(FaultLine, 'getK', FaultLine.get_k)
monkey_the_camel(FaultLine, 'getPolyline', FaultLine.get_polyline)
monkey_the_camel(FaultLine, 'getIJPolyline', FaultLine.get_ij_polyline)
monkey_the_camel(FaultLine, 'getNeighborCells', FaultLine.get_neighbor_cells)
monkey_the_camel(FaultLine, 'startPoint', FaultLine.start_point)
monkey_the_camel(FaultLine, 'endPoint', FaultLine.end_point)
github OPM / ResInsight / ThirdParty / Ert / python / ecl / grid / faults / fault.py View on Github external
for ij in join:
                xyz = fault1.__grid.getNodeXYZ(ij[0], ij[1], k)
                xy_list.append((xyz[0], xyz[1]))

            return xy_list
        else:
            return fault1.endJoin(fault2, k)


monkey_the_camel(FaultLayer, 'addSegment', FaultLayer.add_segment)
monkey_the_camel(FaultLayer, 'getK', FaultLayer.get_k)
monkey_the_camel(FaultLayer, 'getNeighborCells', FaultLayer.get_neighbor_cells)
monkey_the_camel(FaultLayer, 'getPolyline', FaultLayer.get_polyline)
monkey_the_camel(FaultLayer, 'getIJPolyline', FaultLayer.get_ij_polyline)
monkey_the_camel(FaultLayer, 'numLines', FaultLayer.num_lines)
monkey_the_camel(FaultLayer, 'processSegments', FaultLayer.process_segments)

monkey_the_camel(Fault, 'hasLayer', Fault.has_layer)
monkey_the_camel(Fault, 'addLayer', Fault.add_layer)
monkey_the_camel(Fault, 'createSegment', Fault.create_segment)
monkey_the_camel(Fault, 'addRecord', Fault.add_record)
monkey_the_camel(Fault, 'getName', Fault.get_name)
monkey_the_camel(Fault, 'getNeighborCells', Fault.get_neighbor_cells)
monkey_the_camel(Fault, 'getPolyline', Fault.get_polyline)
monkey_the_camel(Fault, 'getIJPolyline', Fault.get_ij_polyline)
monkey_the_camel(Fault, 'numLines', Fault.num_lines)
monkey_the_camel(Fault, 'connectWithPolyline', Fault.connect_with_polyline)
monkey_the_camel(Fault, 'extendToPolyline', Fault.extend_to_polyline)
monkey_the_camel(Fault, 'intersectsPolyline', Fault.intersects_polyline)
monkey_the_camel(Fault, 'intersectsFault', Fault.intersects_fault)
monkey_the_camel(Fault, 'extendToFault', Fault.extend_to_fault)
monkey_the_camel(Fault, 'extendToEdge', Fault.extend_to_edge)
github equinor / libecl / python / ecl / grid / faults / fault.py View on Github external
if count == 1:
            xy_list = []
            for ij in join:
                xyz = fault1.__grid.getNodeXYZ(ij[0], ij[1], k)
                xy_list.append((xyz[0], xyz[1]))

            return xy_list
        else:
            return fault1.endJoin(fault2, k)


monkey_the_camel(FaultLayer, 'addSegment', FaultLayer.add_segment)
monkey_the_camel(FaultLayer, 'getK', FaultLayer.get_k)
monkey_the_camel(FaultLayer, 'getNeighborCells', FaultLayer.get_neighbor_cells)
monkey_the_camel(FaultLayer, 'getPolyline', FaultLayer.get_polyline)
monkey_the_camel(FaultLayer, 'getIJPolyline', FaultLayer.get_ij_polyline)
monkey_the_camel(FaultLayer, 'numLines', FaultLayer.num_lines)
monkey_the_camel(FaultLayer, 'processSegments', FaultLayer.process_segments)

monkey_the_camel(Fault, 'hasLayer', Fault.has_layer)
monkey_the_camel(Fault, 'addLayer', Fault.add_layer)
monkey_the_camel(Fault, 'createSegment', Fault.create_segment)
monkey_the_camel(Fault, 'addRecord', Fault.add_record)
monkey_the_camel(Fault, 'getName', Fault.get_name)
monkey_the_camel(Fault, 'getNeighborCells', Fault.get_neighbor_cells)
monkey_the_camel(Fault, 'getPolyline', Fault.get_polyline)
monkey_the_camel(Fault, 'getIJPolyline', Fault.get_ij_polyline)
monkey_the_camel(Fault, 'numLines', Fault.num_lines)
monkey_the_camel(Fault, 'connectWithPolyline', Fault.connect_with_polyline)
monkey_the_camel(Fault, 'extendToPolyline', Fault.extend_to_polyline)
monkey_the_camel(Fault, 'intersectsPolyline', Fault.intersects_polyline)
github equinor / libecl / python / ecl / eclfile / ecl_3dkw.py View on Github external
def dims(self):
        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 equinor / libecl / python / ecl / summary / ecl_sum.py View on Github external
import ecl.summary.ecl_sum_keyword_vector
EclSum._dump_csv_line = EclPrototype("void ecl_sum_fwrite_interp_csv_line(ecl_sum, time_t, ecl_sum_vector, FILE)", bind=False)
EclSum._get_interp_vector = EclPrototype("void ecl_sum_get_interp_vector(ecl_sum, time_t, ecl_sum_vector, double_vector)", bind=False)
EclSum._init_pandas_frame = EclPrototype("void ecl_sum_init_double_frame(ecl_sum, ecl_sum_vector, double*)", bind=False)
EclSum._init_pandas_frame_interp = EclPrototype("void ecl_sum_init_double_frame_interp(ecl_sum, ecl_sum_vector, time_t_vector, double*)", bind=False)

monkey_the_camel(EclSum, 'varType', EclSum.var_type, classmethod)
monkey_the_camel(EclSum, 'addVariable', EclSum.add_variable)
monkey_the_camel(EclSum, 'addTStep', EclSum.add_t_step)
monkey_the_camel(EclSum, 'assertKeyValid', EclSum.assert_key_valid)
monkey_the_camel(EclSum, 'scaleVector', EclSum.scale_vector)
monkey_the_camel(EclSum, 'shiftVector', EclSum.shift_vector)
monkey_the_camel(EclSum, 'timeRange', EclSum.time_range)
monkey_the_camel(EclSum, 'blockedProduction', EclSum.blocked_production)
monkey_the_camel(EclSum, 'getDataStartTime', EclSum.get_data_start_time)
monkey_the_camel(EclSum, 'getStartTime', EclSum.get_start_time)
monkey_the_camel(EclSum, 'getEndTime', EclSum.get_end_time)
monkey_the_camel(EclSum, 'solveDates', EclSum.solve_dates)
monkey_the_camel(EclSum, 'solveDays', EclSum.solve_days)
monkey_the_camel(EclSum, 'dumpCSVLine', EclSum.dump_csv_line)
monkey_the_camel(EclSum, 'exportCSV', EclSum.export_csv)
github equinor / libecl / python / ecl / eclfile / fortio.py View on Github external
the situation where you need to ensure resource cleanup.

       import sys
       from ecl.ecl import FortIO, EclFile

       rst_file = EclFile(sys.argv[1])
       with openFortIO("PRESSURE", mode=FortIO.WRITE_MODE) as fortio:
          for kw in rst_file:
              if kw.name() == "PRESSURE":
                 kw.write(fortio)

    """
    return FortIOContextManager(FortIO(file_name, mode=mode, fmt_file=fmt_file,
                                       endian_flip_header=endian_flip_header))

monkey_the_camel(FortIO, 'getPosition', FortIO.get_position)
monkey_the_camel(FortIO, 'isFortranFile', FortIO.is_fortran_file, classmethod)
github equinor / libecl / python / ecl / summary / ecl_cmp.py View on Github external
def test_keys(self):
        """
        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 / ecl / summary / ecl_sum.py View on Github external
import ecl.summary.ecl_sum_keyword_vector
EclSum._dump_csv_line = EclPrototype("void ecl_sum_fwrite_interp_csv_line(ecl_sum, time_t, ecl_sum_vector, FILE)", bind=False)
EclSum._get_interp_vector = EclPrototype("void ecl_sum_get_interp_vector(ecl_sum, time_t, ecl_sum_vector, double_vector)", bind=False)
EclSum._init_pandas_frame = EclPrototype("void ecl_sum_init_double_frame(ecl_sum, ecl_sum_vector, double*)", bind=False)
EclSum._init_pandas_frame_interp = EclPrototype("void ecl_sum_init_double_frame_interp(ecl_sum, ecl_sum_vector, time_t_vector, double*)", bind=False)

monkey_the_camel(EclSum, 'varType', EclSum.var_type, classmethod)
monkey_the_camel(EclSum, 'addVariable', EclSum.add_variable)
monkey_the_camel(EclSum, 'addTStep', EclSum.add_t_step)
monkey_the_camel(EclSum, 'assertKeyValid', EclSum.assert_key_valid)
monkey_the_camel(EclSum, 'scaleVector', EclSum.scale_vector)
monkey_the_camel(EclSum, 'shiftVector', EclSum.shift_vector)
monkey_the_camel(EclSum, 'timeRange', EclSum.time_range)
monkey_the_camel(EclSum, 'blockedProduction', EclSum.blocked_production)
monkey_the_camel(EclSum, 'getDataStartTime', EclSum.get_data_start_time)
monkey_the_camel(EclSum, 'getStartTime', EclSum.get_start_time)
monkey_the_camel(EclSum, 'getEndTime', EclSum.get_end_time)
monkey_the_camel(EclSum, 'solveDates', EclSum.solve_dates)
monkey_the_camel(EclSum, 'solveDays', EclSum.solve_days)
monkey_the_camel(EclSum, 'dumpCSVLine', EclSum.dump_csv_line)
monkey_the_camel(EclSum, 'exportCSV', EclSum.export_csv)