Skip to content

Commit

Permalink
Rename non-unique cwrap names
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Nov 13, 2023
1 parent e697e5f commit 653f8b8
Show file tree
Hide file tree
Showing 46 changed files with 607 additions and 598 deletions.
30 changes: 13 additions & 17 deletions python/resdata/geometry/cpolyline.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,30 @@


class CPolyline(BaseCClass):
TYPE_NAME = "geo_polygon"
TYPE_NAME = "rd_geo_polygon"

_alloc_new = ResdataPrototype(
"void* geo_polygon_alloc( char* )", bind=False
)
_alloc_new = ResdataPrototype("void* geo_polygon_alloc(char*)", bind=False)
_fread_alloc_irap = ResdataPrototype(
"geo_polygon_obj geo_polygon_fload_alloc_irap( char* )", bind=False
"rd_geo_polygon_obj geo_polygon_fload_alloc_irap(char*)", bind=False
)
_add_point = ResdataPrototype(
"void geo_polygon_add_point( geo_polygon , double , double )"
"void geo_polygon_add_point(rd_geo_polygon, double, double)"
)
_add_point_front = ResdataPrototype(
"void geo_polygon_add_point_front( geo_polygon , double , double )"
"void geo_polygon_add_point_front(rd_geo_polygon, double, double)"
)
_free = ResdataPrototype("void geo_polygon_free( geo_polygon )")
_size = ResdataPrototype("int geo_polygon_get_size( geo_polygon )")
_free = ResdataPrototype("void geo_polygon_free(rd_geo_polygon)")
_size = ResdataPrototype("int geo_polygon_get_size(rd_geo_polygon)")
_iget_xy = ResdataPrototype(
"void geo_polygon_iget_xy( geo_polygon , int , double* , double* )"
"void geo_polygon_iget_xy(rd_geo_polygon, int, double*, double*)"
)
_segment_intersects = ResdataPrototype(
"bool geo_polygon_segment_intersects( geo_polygon , double , double, double , double)"
)
_get_name = ResdataPrototype("char* geo_polygon_get_name( geo_polygon )")
_set_name = ResdataPrototype(
"void geo_polygon_set_name( geo_polygon , char* )"
"bool geo_polygon_segment_intersects(rd_geo_polygon, double, double, double, double)"
)
_segment_length = ResdataPrototype("double geo_polygon_get_length( geo_polygon)")
_equal = ResdataPrototype("bool geo_polygon_equal( geo_polygon , geo_polygon )")
_get_name = ResdataPrototype("char* geo_polygon_get_name(rd_geo_polygon)")
_set_name = ResdataPrototype("void geo_polygon_set_name(rd_geo_polygon, char*)")
_segment_length = ResdataPrototype("double geo_polygon_get_length(rd_geo_polygon)")
_equal = ResdataPrototype("bool geo_polygon_equal(rd_geo_polygon, rd_geo_polygon)")

def __init__(self, name=None, init_points=()):
c_ptr = self._alloc_new(name)
Expand Down
20 changes: 9 additions & 11 deletions python/resdata/geometry/cpolyline_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,29 @@


class CPolylineCollection(BaseCClass):
TYPE_NAME = "geo_polygon_collection"
TYPE_NAME = "rd_geo_polygon_collection"

_alloc_new = ResdataPrototype(
"void* geo_polygon_collection_alloc( )", bind=False
)
_alloc_new = ResdataPrototype("void* geo_polygon_collection_alloc( )", bind=False)
_free = ResdataPrototype(
"void geo_polygon_collection_free( geo_polygon_collection )"
"void geo_polygon_collection_free(rd_geo_polygon_collection)"
)
_size = ResdataPrototype(
"int geo_polygon_collection_size( geo_polygon_collection)"
"int geo_polygon_collection_size(rd_geo_polygon_collection)"
)
_create_polyline = ResdataPrototype(
"geo_polygon_ref geo_polygon_collection_create_polygon(geo_polygon_collection , char*)"
"rd_geo_polygon_ref geo_polygon_collection_create_polygon(rd_geo_polygon_collection, char*)"
)
_has_polyline = ResdataPrototype(
"bool geo_polygon_collection_has_polygon(geo_polygon_collection , char*)"
"bool geo_polygon_collection_has_polygon(rd_geo_polygon_collection, char*)"
)
_iget = ResdataPrototype(
"geo_polygon_ref geo_polygon_collection_iget_polygon(geo_polygon_collection , int)"
"rd_geo_polygon_ref geo_polygon_collection_iget_polygon(rd_geo_polygon_collection, int)"
)
_get = ResdataPrototype(
"geo_polygon_ref geo_polygon_collection_get_polygon(geo_polygon_collection , char*)"
"rd_geo_polygon_ref geo_polygon_collection_get_polygon(rd_geo_polygon_collection, char*)"
)
_add_polyline = ResdataPrototype(
"void geo_polygon_collection_add_polygon(geo_polygon_collection , geo_polygon , bool)"
"void geo_polygon_collection_add_polygon(rd_geo_polygon_collection, rd_geo_polygon, bool)"
)

def __init__(self):
Expand Down
24 changes: 6 additions & 18 deletions python/resdata/geometry/geo_pointset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@


class GeoPointset(BaseCClass):
TYPE_NAME = "geo_pointset"
TYPE_NAME = "rd_geo_points"

_alloc = ResdataPrototype("void* geo_pointset_alloc(bool)", bind=False)
_free = ResdataPrototype("void geo_pointset_free(geo_pointset)")
# _add_xyz = ResdataPrototype("void geo_pointset_add_xyz(geo_pointset, double, double, double)")
_get_size = ResdataPrototype("int geo_pointset_get_size(geo_pointset)")
# _iget_xy = ResdataPrototype("void geo_pointset_iget_xy(geo_pointset, int, double*, double*)")
# _get_zcoord = ResdataPrototype("double* geo_pointset_get_zcoord(geo_pointset)")
_equal = ResdataPrototype("bool geo_pointset_equal(geo_pointset, geo_pointset)")
_iget_z = ResdataPrototype("double geo_pointset_iget_z(geo_pointset, int)")
# _iset_z = ResdataPrototype("void geo_pointset_iset_z(geo_pointset, int, double)")
# _memcpy = ResdataPrototype("void geo_pointset_memcpy(geo_pointset, geo_pointset, bool)")
# _shift_z = ResdataPrototype("void geo_pointset_shift_z(geo_pointset, double)")
# _assign_z = ResdataPrototype("void geo_pointset_assign_z(geo_pointset, double)")
# _scale_z = ResdataPrototype("void geo_pointset_scale_z(geo_pointset, double)")
# _imul = ResdataPrototype("void geo_pointset_imul(geo_pointset, geo_pointset)")
# _iadd = ResdataPrototype("void geo_pointset_iadd(geo_pointset, geo_pointset)")
# _isub = ResdataPrototype("void geo_pointset_isub(geo_pointset, geo_pointset)")
# _isqrt = ResdataPrototype("void geo_pointset_isqrt(geo_pointset)")
_alloc = ResdataPrototype("void* geo_pointset_alloc(bool)", bind=False)
_free = ResdataPrototype("void geo_pointset_free(rd_geo_points)")
_get_size = ResdataPrototype("int geo_pointset_get_size(rd_geo_points)")
_equal = ResdataPrototype("bool geo_pointset_equal(rd_geo_points, rd_geo_points)")
_iget_z = ResdataPrototype("double geo_pointset_iget_z(rd_geo_points, int)")

def __init__(self, external_z=False):
c_ptr = self._alloc(external_z)
Expand Down
26 changes: 13 additions & 13 deletions python/resdata/geometry/geo_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,37 @@


class GeoRegion(BaseCClass):
TYPE_NAME = "geo_region"
TYPE_NAME = "rd_geo_region"

_alloc = ResdataPrototype("void* geo_region_alloc(geo_pointset, bool)", bind=False)
_free = ResdataPrototype("void geo_region_free(geo_region)")
_reset = ResdataPrototype("void geo_region_reset(geo_region)")
_alloc = ResdataPrototype("void* geo_region_alloc(rd_geo_points, bool)", bind=False)
_free = ResdataPrototype("void geo_region_free(rd_geo_region)")
_reset = ResdataPrototype("void geo_region_reset(rd_geo_region)")
_get_index_list = ResdataPrototype(
"int_vector_ref geo_region_get_index_list(geo_region)"
"rd_int_vector_ref geo_region_get_index_list(rd_geo_region)"
)
_select_inside_polygon = ResdataPrototype(
"void geo_region_select_inside_polygon(geo_region, geo_polygon)"
"void geo_region_select_inside_polygon(rd_geo_region, rd_geo_polygon)"
)
_select_outside_polygon = ResdataPrototype(
"void geo_region_select_outside_polygon(geo_region, geo_polygon)"
"void geo_region_select_outside_polygon(rd_geo_region, rd_geo_polygon)"
)
_deselect_inside_polygon = ResdataPrototype(
"void geo_region_deselect_inside_polygon(geo_region, geo_polygon)"
"void geo_region_deselect_inside_polygon(rd_geo_region, rd_geo_polygon)"
)
_deselect_outside_polygon = ResdataPrototype(
"void geo_region_deselect_outside_polygon(geo_region, geo_polygon)"
"void geo_region_deselect_outside_polygon(rd_geo_region, rd_geo_polygon)"
)
_select_above_line = ResdataPrototype(
"void geo_region_select_above_line(geo_region, double*, double*)"
"void geo_region_select_above_line(rd_geo_region, double*, double*)"
)
_select_below_line = ResdataPrototype(
"void geo_region_select_below_line(geo_region, double*, double*)"
"void geo_region_select_below_line(rd_geo_region, double*, double*)"
)
_deselect_above_line = ResdataPrototype(
"void geo_region_deselect_above_line(geo_region, double*, double*)"
"void geo_region_deselect_above_line(rd_geo_region, double*, double*)"
)
_deselect_below_line = ResdataPrototype(
"void geo_region_deselect_below_line(geo_region, double*, double*)"
"void geo_region_deselect_below_line(rd_geo_region, double*, double*)"
)

def __init__(self, pointset, preselect=False):
Expand Down
42 changes: 21 additions & 21 deletions python/resdata/geometry/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,40 @@


class Surface(BaseCClass):
TYPE_NAME = "surface"
TYPE_NAME = "rd_surface"

_alloc = ResdataPrototype(
"void* geo_surface_fload_alloc_irap( char* , bool )", bind=False
"void* geo_surface_fload_alloc_irap(char*, bool)", bind=False
)
_free = ResdataPrototype("void geo_surface_free( surface )")
_free = ResdataPrototype("void geo_surface_free(rd_surface)")
_new = ResdataPrototype(
"void* geo_surface_alloc_new( int, int, double, double, double, double, double )",
"void* geo_surface_alloc_new(int, int, double, double, double, double, double)",
bind=False,
)
_get_nx = ResdataPrototype("int geo_surface_get_nx( surface )")
_get_ny = ResdataPrototype("int geo_surface_get_ny( surface )")
_iget_zvalue = ResdataPrototype("double geo_surface_iget_zvalue( surface , int)")
_get_nx = ResdataPrototype("int geo_surface_get_nx(rd_surface)")
_get_ny = ResdataPrototype("int geo_surface_get_ny(rd_surface)")
_iget_zvalue = ResdataPrototype("double geo_surface_iget_zvalue(rd_surface, int)")
_iset_zvalue = ResdataPrototype(
"void geo_surface_iset_zvalue( surface , int , double)"
"void geo_surface_iset_zvalue(rd_surface, int, double)"
)
_write = ResdataPrototype("void geo_surface_fprintf_irap( surface , char* )")
_equal = ResdataPrototype("bool geo_surface_equal( surface , surface )")
_write = ResdataPrototype("void geo_surface_fprintf_irap(rd_surface, char*)")
_equal = ResdataPrototype("bool geo_surface_equal(rd_surface, rd_surface)")
_header_equal = ResdataPrototype(
"bool geo_surface_equal_header( surface , surface )"
"bool geo_surface_equal_header(rd_surface, rd_surface)"
)
_copy = ResdataPrototype("surface_obj geo_surface_alloc_copy( surface , bool )")
_assign = ResdataPrototype("void geo_surface_assign_value( surface , double )")
_scale = ResdataPrototype("void geo_surface_scale( surface , double )")
_shift = ResdataPrototype("void geo_surface_shift( surface , double )")
_iadd = ResdataPrototype("void geo_surface_iadd( surface , surface )")
_imul = ResdataPrototype("void geo_surface_imul( surface , surface )")
_isub = ResdataPrototype("void geo_surface_isub( surface , surface )")
_isqrt = ResdataPrototype("void geo_surface_isqrt( surface )")
_copy = ResdataPrototype("rd_surface_obj geo_surface_alloc_copy(rd_surface, bool)")
_assign = ResdataPrototype("void geo_surface_assign_value(rd_surface, double)")
_scale = ResdataPrototype("void geo_surface_scale(rd_surface, double)")
_shift = ResdataPrototype("void geo_surface_shift(rd_surface, double)")
_iadd = ResdataPrototype("void geo_surface_iadd(rd_surface, rd_surface)")
_imul = ResdataPrototype("void geo_surface_imul(rd_surface, rd_surface)")
_isub = ResdataPrototype("void geo_surface_isub(rd_surface, rd_surface)")
_isqrt = ResdataPrototype("void geo_surface_isqrt(rd_surface)")
_iget_xy = ResdataPrototype(
"void geo_surface_iget_xy(surface, int, double*, double*)"
"void geo_surface_iget_xy(rd_surface, int, double*, double*)"
)
_get_pointset = ResdataPrototype(
"geo_pointset_ref geo_surface_get_pointset(surface)"
"rd_geo_points_ref geo_surface_get_pointset(rd_surface)"
)

def __init__(
Expand Down
28 changes: 13 additions & 15 deletions python/resdata/grid/faults/fault_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,32 @@ def __str__(self):


class FaultBlock(BaseCClass):
TYPE_NAME = "fault_block"
TYPE_NAME = "rd_fault_block"

_get_xc = ResdataPrototype("double fault_block_get_xc(fault_block)")
_get_yc = ResdataPrototype("double fault_block_get_yc(fault_block)")
_get_block_id = ResdataPrototype("int fault_block_get_id(fault_block)")
_get_size = ResdataPrototype("int fault_block_get_size(fault_block)")
_get_xc = ResdataPrototype("double fault_block_get_xc(rd_fault_block)")
_get_yc = ResdataPrototype("double fault_block_get_yc(rd_fault_block)")
_get_block_id = ResdataPrototype("int fault_block_get_id(rd_fault_block)")
_get_size = ResdataPrototype("int fault_block_get_size(rd_fault_block)")
_export_cell = ResdataPrototype(
"void fault_block_export_cell(fault_block, int, int*, int*, int*, double*, double*, double*)"
"void fault_block_export_cell(rd_fault_block, int, int*, int*, int*, double*, double*, double*)"
)
_assign_to_region = ResdataPrototype(
"void fault_block_assign_to_region(fault_block, int)"
"void fault_block_assign_to_region(rd_fault_block, int)"
)
_get_region_list = ResdataPrototype(
"int_vector_ref fault_block_get_region_list(fault_block)"
)
_add_cell = ResdataPrototype(
"void fault_block_add_cell(fault_block, int, int)"
"rd_int_vector_ref fault_block_get_region_list(rd_fault_block)"
)
_add_cell = ResdataPrototype("void fault_block_add_cell(rd_fault_block, int, int)")
_get_global_index_list = ResdataPrototype(
"int_vector_ref fault_block_get_global_index_list(fault_block)"
"rd_int_vector_ref fault_block_get_global_index_list(rd_fault_block)"
)
_trace_edge = ResdataPrototype(
"void fault_block_trace_edge(fault_block, double_vector, double_vector, int_vector)"
"void fault_block_trace_edge(rd_fault_block, rd_double_vector, rd_double_vector, rd_int_vector)"
)
_get_neighbours = ResdataPrototype(
"void fault_block_list_neighbours(fault_block, bool, geo_polygon_collection, int_vector)"
"void fault_block_list_neighbours(rd_fault_block, bool, rd_geo_polygon_collection, rd_int_vector)"
)
_free = ResdataPrototype("void fault_block_free__(fault_block)")
_free = ResdataPrototype("void fault_block_free__(rd_fault_block)")

def __init__(self, *args, **kwargs):
raise NotImplementedError("Class can not be instantiated directly!")
Expand Down
10 changes: 5 additions & 5 deletions python/resdata/grid/faults/fault_block_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@


class FaultBlockCollection(BaseCClass):
TYPE_NAME = "fault_block_collection"
TYPE_NAME = "rd_fault_block_collection"
_alloc = ResdataPrototype("void* fault_block_collection_alloc(rd_grid)", bind=False)
_free = ResdataPrototype(
"void fault_block_collection_free(fault_block_collection)"
"void fault_block_collection_free(rd_fault_block_collection)"
)
_num_layers = ResdataPrototype(
"int fault_block_collection_num_layers(fault_block_collection)"
"int fault_block_collection_num_layers(rd_fault_block_collection)"
)
_scan_keyword = ResdataPrototype(
"bool fault_block_collection_scan_kw(fault_block_collection, rd_kw)"
"bool fault_block_collection_scan_kw(rd_fault_block_collection, rd_kw)"
)
_get_layer = ResdataPrototype(
"fault_block_layer_ref fault_block_collection_get_layer(fault_block_collection, int)"
"rd_fault_block_layer_ref fault_block_collection_get_layer(rd_fault_block_collection, int)"
)

def __init__(self, grid):
Expand Down
40 changes: 17 additions & 23 deletions python/resdata/grid/faults/fault_block_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,48 @@


class FaultBlockLayer(BaseCClass):
TYPE_NAME = "fault_block_layer"
TYPE_NAME = "rd_fault_block_layer"
_alloc = ResdataPrototype(
"void* fault_block_layer_alloc(rd_grid, int)", bind=False
)
_free = ResdataPrototype(
"void fault_block_layer_free(fault_block_layer)"
)
_size = ResdataPrototype(
"int fault_block_layer_get_size(fault_block_layer)"
"void* fault_block_layer_alloc(rd_grid, int)", bind=False
)
_free = ResdataPrototype("void fault_block_layer_free(rd_fault_block_layer)")
_size = ResdataPrototype("int fault_block_layer_get_size(rd_fault_block_layer)")
_iget_block = ResdataPrototype(
"fault_block_ref fault_block_layer_iget_block(fault_block_layer, int)"
"rd_fault_block_ref fault_block_layer_iget_block(rd_fault_block_layer, int)"
)
_add_block = ResdataPrototype(
"fault_block_ref fault_block_layer_add_block(fault_block_layer, int)"
"rd_fault_block_ref fault_block_layer_add_block(rd_fault_block_layer, int)"
)
_get_block = ResdataPrototype(
"fault_block_ref fault_block_layer_get_block(fault_block_layer, int)"
"rd_fault_block_ref fault_block_layer_get_block(rd_fault_block_layer, int)"
)
_del_block = ResdataPrototype(
"void fault_block_layer_del_block(fault_block_layer, int)"
"void fault_block_layer_del_block(rd_fault_block_layer, int)"
)
_has_block = ResdataPrototype(
"bool fault_block_layer_has_block(fault_block_layer, int)"
"bool fault_block_layer_has_block(rd_fault_block_layer, int)"
)
_scan_keyword = ResdataPrototype(
"bool fault_block_layer_scan_kw(fault_block_layer, rd_kw)"
"bool fault_block_layer_scan_kw(rd_fault_block_layer, rd_kw)"
)
_load_keyword = ResdataPrototype(
"bool fault_block_layer_load_kw(fault_block_layer, rd_kw)"
)
_getK = ResdataPrototype(
"int fault_block_layer_get_k(fault_block_layer)"
"bool fault_block_layer_load_kw(rd_fault_block_layer, rd_kw)"
)
_getK = ResdataPrototype("int fault_block_layer_get_k(rd_fault_block_layer)")
_get_next_id = ResdataPrototype(
"int fault_block_layer_get_next_id(fault_block_layer)"
"int fault_block_layer_get_next_id(rd_fault_block_layer)"
)
_scan_layer = ResdataPrototype(
"void fault_block_layer_scan_layer(fault_block_layer, layer)"
"void fault_block_layer_scan_layer(rd_fault_block_layer, rd_layer)"
)
_insert_block_content = ResdataPrototype(
"void fault_block_layer_insert_block_content(fault_block_layer, fault_block)"
"void fault_block_layer_insert_block_content(rd_fault_block_layer, rd_fault_block)"
)
_export_kw = ResdataPrototype(
"bool fault_block_layer_export(fault_block_layer, rd_kw)"
"bool fault_block_layer_export(rd_fault_block_layer, rd_kw)"
)
_get_layer = ResdataPrototype(
"layer_ref fault_block_layer_get_layer(fault_block_layer)"
"rd_layer_ref fault_block_layer_get_layer(rd_fault_block_layer)"
)

def __init__(self, grid, k):
Expand Down
Loading

0 comments on commit 653f8b8

Please sign in to comment.