mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
ifcopenshell_wrapper.pyi - update from the latest build
I guess previously I used some of my local builds, so some symbols were missing.
This commit is contained in:
@@ -132,11 +132,6 @@ class BRepElement(Element):
|
|||||||
@property
|
@property
|
||||||
def volume(self): ...
|
def volume(self): ...
|
||||||
|
|
||||||
class CacheShapes:
|
|
||||||
name: Any
|
|
||||||
description: Any
|
|
||||||
defaultvalue: Any
|
|
||||||
|
|
||||||
class CgalEmitOriginalEdges:
|
class CgalEmitOriginalEdges:
|
||||||
name: Any
|
name: Any
|
||||||
description: Any
|
description: Any
|
||||||
@@ -262,6 +257,15 @@ class GeometrySerializer:
|
|||||||
def settings(self, *args): ...
|
def settings(self, *args): ...
|
||||||
def write(self, *args): ...
|
def write(self, *args): ...
|
||||||
|
|
||||||
|
class GltfSerializer(WriteOnlyGeometrySerializer):
|
||||||
|
def finalize(self): ...
|
||||||
|
def isTesselated(self): ...
|
||||||
|
def ready(self): ...
|
||||||
|
def setFile(self, arg2): ...
|
||||||
|
def setUnitNameAndMagnitude(self, arg2, arg3): ...
|
||||||
|
def write(self, *args): ...
|
||||||
|
def writeHeader(self): ...
|
||||||
|
|
||||||
class HdfSerializer(GeometrySerializer):
|
class HdfSerializer(GeometrySerializer):
|
||||||
def finalize(self): ...
|
def finalize(self): ...
|
||||||
def isTesselated(self): ...
|
def isTesselated(self): ...
|
||||||
@@ -293,9 +297,13 @@ class IfcEntityInstanceData: ...
|
|||||||
class IfcLateBoundEntity(IfcBaseEntity):
|
class IfcLateBoundEntity(IfcBaseEntity):
|
||||||
def declaration(self): ...
|
def declaration(self): ...
|
||||||
|
|
||||||
class InstanceReference: ...
|
class InstanceReference:
|
||||||
|
file_offset: Any
|
||||||
|
v: Any
|
||||||
|
|
||||||
class Iterator:
|
class Iterator:
|
||||||
|
initialization_outcome_: Any
|
||||||
|
processed_: Any
|
||||||
def bounds_max(self): ...
|
def bounds_max(self): ...
|
||||||
def bounds_min(self): ...
|
def bounds_min(self): ...
|
||||||
def compute_bounds(self, with_geometry): ...
|
def compute_bounds(self, with_geometry): ...
|
||||||
@@ -316,11 +324,6 @@ class Iterator:
|
|||||||
def unit_magnitude(self): ...
|
def unit_magnitude(self): ...
|
||||||
def unit_name(self): ...
|
def unit_name(self): ...
|
||||||
|
|
||||||
class OcctNoCleanTriangulation:
|
|
||||||
name: Any
|
|
||||||
description: Any
|
|
||||||
defaultvalue: Any
|
|
||||||
|
|
||||||
class OpaqueCoordinate_3:
|
class OpaqueCoordinate_3:
|
||||||
def get(self, i): ...
|
def get(self, i): ...
|
||||||
def set(self, i, n): ...
|
def set(self, i, n): ...
|
||||||
@@ -334,11 +337,6 @@ class OpaqueNumber:
|
|||||||
def to_double(self): ...
|
def to_double(self): ...
|
||||||
def to_string(self): ...
|
def to_string(self): ...
|
||||||
|
|
||||||
class PermissiveShapeReuse:
|
|
||||||
name: Any
|
|
||||||
description: Any
|
|
||||||
defaultvalue: Any
|
|
||||||
|
|
||||||
class Representation:
|
class Representation:
|
||||||
def entity(self): ...
|
def entity(self): ...
|
||||||
@property
|
@property
|
||||||
@@ -544,6 +542,8 @@ class XmlSerializerFactory:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def implementations(): ...
|
def implementations(): ...
|
||||||
|
|
||||||
|
class _SwigNonDynamicMeta(type): ...
|
||||||
|
|
||||||
class abstract_arrangement:
|
class abstract_arrangement:
|
||||||
def get_face_pairs(self): ...
|
def get_face_pairs(self): ...
|
||||||
def merge(self, edge_indices): ...
|
def merge(self, edge_indices): ...
|
||||||
@@ -574,6 +574,7 @@ class boolean_result:
|
|||||||
INTERSECTION: Any
|
INTERSECTION: Any
|
||||||
SUBTRACTION: Any
|
SUBTRACTION: Any
|
||||||
UNION: Any
|
UNION: Any
|
||||||
|
operation: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
@property
|
@property
|
||||||
def children(self): ...
|
def children(self): ...
|
||||||
@@ -583,11 +584,21 @@ class boolean_result:
|
|||||||
def operation_str(op): ...
|
def operation_str(op): ...
|
||||||
|
|
||||||
class bspline_curve(curve):
|
class bspline_curve(curve):
|
||||||
|
control_points: Any
|
||||||
|
degree: Any
|
||||||
|
knots: Any
|
||||||
|
multiplicities: Any
|
||||||
|
weights: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
|
|
||||||
class bspline_surface(surface):
|
class bspline_surface(surface):
|
||||||
|
control_points: Any
|
||||||
|
degree: Any
|
||||||
|
knots: Any
|
||||||
|
multiplicities: Any
|
||||||
|
weights: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
@@ -607,6 +618,7 @@ class cant_function(function_item):
|
|||||||
def start(self): ...
|
def start(self): ...
|
||||||
|
|
||||||
class circle(curve):
|
class circle(curve):
|
||||||
|
radius: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -615,7 +627,13 @@ class circle(curve):
|
|||||||
@property
|
@property
|
||||||
def matrix(self): ...
|
def matrix(self): ...
|
||||||
|
|
||||||
class clash: ...
|
class clash:
|
||||||
|
a: Any
|
||||||
|
b: Any
|
||||||
|
clash_type: Any
|
||||||
|
distance: Any
|
||||||
|
p1: Any
|
||||||
|
p2: Any
|
||||||
|
|
||||||
class clashes:
|
class clashes:
|
||||||
def append(self, x): ...
|
def append(self, x): ...
|
||||||
@@ -673,6 +691,7 @@ class curve(geom_item):
|
|||||||
def print_impl(self, o, classname, indent): ...
|
def print_impl(self, o, classname, indent): ...
|
||||||
|
|
||||||
class cylinder(surface):
|
class cylinder(surface):
|
||||||
|
radius: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
@@ -697,7 +716,9 @@ class direction3:
|
|||||||
def components(self): ...
|
def components(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
|
|
||||||
class drawing_meta: ...
|
class drawing_meta:
|
||||||
|
matrix_3: Any
|
||||||
|
pln_3d: Any
|
||||||
|
|
||||||
class edge(trimmed_curve):
|
class edge(trimmed_curve):
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
@@ -705,6 +726,8 @@ class edge(trimmed_curve):
|
|||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
|
|
||||||
class ellipse(curve):
|
class ellipse(curve):
|
||||||
|
radius: Any
|
||||||
|
radius2: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
@@ -729,6 +752,8 @@ class entity(declaration):
|
|||||||
def supertype(self): ...
|
def supertype(self): ...
|
||||||
|
|
||||||
class entity_instance:
|
class entity_instance:
|
||||||
|
file_: Any
|
||||||
|
id_: Any
|
||||||
def data(self, *args): ...
|
def data(self, *args): ...
|
||||||
def declaration(self): ...
|
def declaration(self): ...
|
||||||
def file_pointer(self): ...
|
def file_pointer(self): ...
|
||||||
@@ -768,9 +793,9 @@ class enumeration_type(declaration):
|
|||||||
def lookup_enum_offset(self, string): ...
|
def lookup_enum_offset(self, string): ...
|
||||||
def lookup_enum_value(self, i): ...
|
def lookup_enum_value(self, i): ...
|
||||||
|
|
||||||
class equal_functor: ...
|
|
||||||
|
|
||||||
class extrusion(sweep):
|
class extrusion(sweep):
|
||||||
|
depth: Any
|
||||||
|
direction: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
@@ -778,6 +803,7 @@ class extrusion(sweep):
|
|||||||
def matrix(self): ...
|
def matrix(self): ...
|
||||||
|
|
||||||
class face:
|
class face:
|
||||||
|
basis: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
@property
|
@property
|
||||||
def children(self): ...
|
def children(self): ...
|
||||||
@@ -791,6 +817,8 @@ class file:
|
|||||||
INSTANCE_ID: Any
|
INSTANCE_ID: Any
|
||||||
INSTANCE_TYPE: Any
|
INSTANCE_TYPE: Any
|
||||||
ATTRIBUTE_INDEX: Any
|
ATTRIBUTE_INDEX: Any
|
||||||
|
guid_map_: Any
|
||||||
|
stream: Any
|
||||||
def FreshId(self): ...
|
def FreshId(self): ...
|
||||||
def add(self, entity, id): ...
|
def add(self, entity, id): ...
|
||||||
def addEntities(self, entities): ...
|
def addEntities(self, entities): ...
|
||||||
@@ -846,6 +874,7 @@ class file_open_status:
|
|||||||
def value(self): ...
|
def value(self): ...
|
||||||
|
|
||||||
class fn_evaluator:
|
class fn_evaluator:
|
||||||
|
settings_: Any
|
||||||
def clone(self): ...
|
def clone(self): ...
|
||||||
def end(self): ...
|
def end(self): ...
|
||||||
def evaluate(self, u): ...
|
def evaluate(self, u): ...
|
||||||
@@ -870,7 +899,9 @@ class functor_item(function_item):
|
|||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
def start(self): ...
|
def start(self): ...
|
||||||
|
|
||||||
class geom_item(item): ...
|
class geom_item(item):
|
||||||
|
matrix: Any
|
||||||
|
surface_style: Any
|
||||||
|
|
||||||
class geometry_exception:
|
class geometry_exception:
|
||||||
def what(self): ...
|
def what(self): ...
|
||||||
@@ -884,7 +915,6 @@ class gradient_function(function_item):
|
|||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
def start(self): ...
|
def start(self): ...
|
||||||
|
|
||||||
class hash_functor: ...
|
|
||||||
class horizontal_plan_at_element: ...
|
class horizontal_plan_at_element: ...
|
||||||
class implicit_item(geom_item): ...
|
class implicit_item(geom_item): ...
|
||||||
|
|
||||||
@@ -901,6 +931,8 @@ class inverse_attribute:
|
|||||||
def type_of_aggregation_string(self): ...
|
def type_of_aggregation_string(self): ...
|
||||||
|
|
||||||
class item:
|
class item:
|
||||||
|
instance: Any
|
||||||
|
orientation: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def hash(self): ...
|
def hash(self): ...
|
||||||
@@ -931,6 +963,7 @@ class line_segment:
|
|||||||
def swap(self, v): ...
|
def swap(self, v): ...
|
||||||
|
|
||||||
class loft:
|
class loft:
|
||||||
|
axis: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
@property
|
@property
|
||||||
def children(self): ...
|
def children(self): ...
|
||||||
@@ -939,6 +972,9 @@ class loft:
|
|||||||
def print_impl(self, o, indent): ...
|
def print_impl(self, o, indent): ...
|
||||||
|
|
||||||
class loop:
|
class loop:
|
||||||
|
closed: Any
|
||||||
|
external: Any
|
||||||
|
fi: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def calculate_linear_edge_curves(self): ...
|
def calculate_linear_edge_curves(self): ...
|
||||||
@property
|
@property
|
||||||
@@ -954,6 +990,7 @@ class matrix4(item):
|
|||||||
AFFINE_W_UNIFORM_SCALE: Any
|
AFFINE_W_UNIFORM_SCALE: Any
|
||||||
AFFINE_W_NONUNIFORM_SCALE: Any
|
AFFINE_W_NONUNIFORM_SCALE: Any
|
||||||
OTHER: Any
|
OTHER: Any
|
||||||
|
tag: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
@property
|
@property
|
||||||
@@ -972,6 +1009,9 @@ class node(item):
|
|||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
|
|
||||||
class offset_curve(curve):
|
class offset_curve(curve):
|
||||||
|
basis: Any
|
||||||
|
offset: Any
|
||||||
|
reference: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
@@ -1016,8 +1056,19 @@ class point3:
|
|||||||
def components(self): ...
|
def components(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
|
|
||||||
class polygon_2: ...
|
class polygon_2:
|
||||||
class ray_intersection_result: ...
|
boundary: Any
|
||||||
|
inner_boundaries: Any
|
||||||
|
point_inside: Any
|
||||||
|
|
||||||
|
class ray_intersection_result:
|
||||||
|
distance: Any
|
||||||
|
dot_product: Any
|
||||||
|
instance: Any
|
||||||
|
normal: Any
|
||||||
|
position: Any
|
||||||
|
ray_distance: Any
|
||||||
|
style_index: Any
|
||||||
|
|
||||||
class ray_intersection_results:
|
class ray_intersection_results:
|
||||||
def append(self, x): ...
|
def append(self, x): ...
|
||||||
@@ -1044,6 +1095,9 @@ class ray_intersection_results:
|
|||||||
def swap(self, v): ...
|
def swap(self, v): ...
|
||||||
|
|
||||||
class revolve(sweep):
|
class revolve(sweep):
|
||||||
|
angle: Any
|
||||||
|
axis_origin: Any
|
||||||
|
direction: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
@@ -1065,6 +1119,7 @@ class select_type(declaration):
|
|||||||
def select_list(self): ...
|
def select_list(self): ...
|
||||||
|
|
||||||
class shell:
|
class shell:
|
||||||
|
closed: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
@property
|
@property
|
||||||
def children(self): ...
|
def children(self): ...
|
||||||
@@ -1094,6 +1149,7 @@ class solid:
|
|||||||
def matrix(self): ...
|
def matrix(self): ...
|
||||||
|
|
||||||
class sphere(surface):
|
class sphere(surface):
|
||||||
|
radius: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
@@ -1101,6 +1157,13 @@ class sphere(surface):
|
|||||||
def matrix(self): ...
|
def matrix(self): ...
|
||||||
|
|
||||||
class style(item):
|
class style(item):
|
||||||
|
diffuse: Any
|
||||||
|
name: Any
|
||||||
|
specular: Any
|
||||||
|
specularity: Any
|
||||||
|
surface: Any
|
||||||
|
transparency: Any
|
||||||
|
use_surface_color: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def get_color(self): ...
|
def get_color(self): ...
|
||||||
@@ -1268,9 +1331,12 @@ class svg_polygons:
|
|||||||
def size(self): ...
|
def size(self): ...
|
||||||
def swap(self, v): ...
|
def swap(self, v): ...
|
||||||
|
|
||||||
class sweep(geom_item): ...
|
class sweep(geom_item):
|
||||||
|
basis: Any
|
||||||
|
|
||||||
class sweep_along_curve(sweep):
|
class sweep_along_curve(sweep):
|
||||||
|
curve: Any
|
||||||
|
surface: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
@@ -1279,6 +1345,8 @@ class too_many_faces_exception(geometry_exception): ...
|
|||||||
class topology_error: ...
|
class topology_error: ...
|
||||||
|
|
||||||
class torus(surface):
|
class torus(surface):
|
||||||
|
radius1: Any
|
||||||
|
radius2: Any
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
def clone_(self): ...
|
def clone_(self): ...
|
||||||
def kind(self): ...
|
def kind(self): ...
|
||||||
@@ -1306,6 +1374,11 @@ class tree:
|
|||||||
def write_h5(self): ...
|
def write_h5(self): ...
|
||||||
|
|
||||||
class trimmed_curve(geom_item):
|
class trimmed_curve(geom_item):
|
||||||
|
basis: Any
|
||||||
|
curve_sense: Any
|
||||||
|
start: Any
|
||||||
|
end: Any
|
||||||
|
|
||||||
def reverse(self): ...
|
def reverse(self): ...
|
||||||
|
|
||||||
class type_by_kind:
|
class type_by_kind:
|
||||||
@@ -1316,12 +1389,7 @@ class type_declaration(declaration):
|
|||||||
def as_type_declaration(self): ...
|
def as_type_declaration(self): ...
|
||||||
def declared_type(self): ...
|
def declared_type(self): ...
|
||||||
|
|
||||||
def Triangulation_box_project_uvs(vertices, normals): ...
|
|
||||||
def Triangulation_empty(settings): ...
|
|
||||||
def XmlSerializerFactory_implementations(): ...
|
|
||||||
def arrange_polygons(polygons): ...
|
def arrange_polygons(polygons): ...
|
||||||
def boolean_result_operation_str(op): ...
|
|
||||||
def circle_from_3_points(p1, p2, p3): ...
|
|
||||||
def clear_schemas(): ...
|
def clear_schemas(): ...
|
||||||
def construct_iterator_with_include_exclude(geometry_library, settings, file, elems, include, num_threads): ...
|
def construct_iterator_with_include_exclude(geometry_library, settings, file, elems, include, num_threads): ...
|
||||||
def construct_iterator_with_include_exclude_globalid(geometry_library, settings, file, elems, include, num_threads): ...
|
def construct_iterator_with_include_exclude_globalid(geometry_library, settings, file, elems, include, num_threads): ...
|
||||||
@@ -1329,10 +1397,6 @@ def construct_iterator_with_include_exclude_id(geometry_library, settings, file,
|
|||||||
def create_box(*args): ...
|
def create_box(*args): ...
|
||||||
def create_epeck(*args): ...
|
def create_epeck(*args): ...
|
||||||
def create_shape(*args): ...
|
def create_shape(*args): ...
|
||||||
def file_createTimestamp(): ...
|
|
||||||
def file_guid_map(*args): ...
|
|
||||||
def file_traverse(instance, max_level): ...
|
|
||||||
def file_traverse_breadth_first(instance, max_level): ...
|
|
||||||
def flatten(deep): ...
|
def flatten(deep): ...
|
||||||
def get_feature(x): ...
|
def get_feature(x): ...
|
||||||
def get_info_cpp(v, include_identifier): ...
|
def get_info_cpp(v, include_identifier): ...
|
||||||
@@ -1359,8 +1423,6 @@ def svg_to_line_segments(data, class_name): ...
|
|||||||
def svg_to_polygons(data, class_name): ...
|
def svg_to_polygons(data, class_name): ...
|
||||||
def taxonomy_item_repr(i): ...
|
def taxonomy_item_repr(i): ...
|
||||||
def tesselate(schema_name, shape_str, d): ...
|
def tesselate(schema_name, shape_str, d): ...
|
||||||
def tree_is_manifold(fs): ...
|
|
||||||
def tree_vector_to_list(ps): ...
|
|
||||||
def turn_off_detailed_logging(): ...
|
def turn_off_detailed_logging(): ...
|
||||||
def turn_on_detailed_logging(): ...
|
def turn_on_detailed_logging(): ...
|
||||||
def version(): ...
|
def version(): ...
|
||||||
|
|||||||
@@ -102,63 +102,73 @@ def get_names_tree_lines(tree: ast.Module) -> list[str]:
|
|||||||
continue
|
continue
|
||||||
subname_ = target.id
|
subname_ = target.id
|
||||||
|
|
||||||
if subname_.startswith("_"):
|
if subname_.startswith(("_", "thisown")):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
value = subnode.value
|
value = subnode.value
|
||||||
# Catching wrappers like:
|
if not isinstance(value, ast.Call):
|
||||||
# - `matrix = property(matrix_getter)`
|
subname = subname_
|
||||||
# - `matrix = property(matrix_getter, matrix_setter)`
|
else:
|
||||||
# - `operation_str = staticmethod(operation_str)`
|
# Catching wrappers like:
|
||||||
if isinstance(value, ast.Call):
|
# - `matrix = property(matrix_getter)`
|
||||||
|
# - `matrix = property(matrix_getter, matrix_setter)`
|
||||||
|
# - `operation_str = staticmethod(operation_str)`
|
||||||
func = value.func
|
func = value.func
|
||||||
if not isinstance(func, ast.Name) or ((func_id := func.id) not in ("property", "staticmethod")):
|
if not isinstance(func, ast.Name) or ((func_id := func.id) not in ("property", "staticmethod")):
|
||||||
continue
|
continue
|
||||||
args = [arg.id for arg in value.args if isinstance(arg, ast.Name)]
|
args = [arg.id for arg in value.args if isinstance(arg, ast.Name)]
|
||||||
len_args = len(args)
|
len_args = len(args)
|
||||||
assert len_args in (1, 2)
|
if len_args in (1, 2):
|
||||||
|
|
||||||
def find_method_by_name(name: str) -> Union[str, None]:
|
def find_method_by_name(name: str) -> Union[str, None]:
|
||||||
function_def = f"def {name}("
|
function_def = f"def {name}("
|
||||||
return next(
|
return next(
|
||||||
(
|
(
|
||||||
func_
|
func_
|
||||||
for func_ in subnames
|
for func_ in subnames
|
||||||
if isinstance(func_, str) and func_.startswith(function_def)
|
if isinstance(func_, str) and func_.startswith(function_def)
|
||||||
),
|
),
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Use `set` for cases like `description = property(description, description)`.
|
# Use `set` for cases like `description = property(description, description)`.
|
||||||
wrapped_function = None
|
wrapped_function = None
|
||||||
for arg in set(args):
|
for arg in set(args):
|
||||||
assert (wrapped_function := find_method_by_name(arg))
|
assert (wrapped_function := find_method_by_name(arg))
|
||||||
subnames.remove(wrapped_function)
|
subnames.remove(wrapped_function)
|
||||||
|
|
||||||
# TODO: sort it out in wrapper.py
|
# TODO: sort it out in wrapper.py
|
||||||
# There's one annoying case in Element.product
|
# There's one annoying case in Element.product
|
||||||
# when property is overriding existing function, without using it.
|
# when property is overriding existing function, without using it.
|
||||||
# We should probably just exclude that function from the wrapper.
|
# We should probably just exclude that function from the wrapper.
|
||||||
overridden_name = find_method_by_name(subname_)
|
overridden_name = find_method_by_name(subname_)
|
||||||
if overridden_name:
|
if overridden_name:
|
||||||
subnames.remove(overridden_name)
|
subnames.remove(overridden_name)
|
||||||
|
|
||||||
if len_args == 2:
|
if len_args == 2:
|
||||||
# Has both getter and setter, can be defined as a simple attribute.
|
# Has both getter and setter, can be defined as a simple attribute.
|
||||||
subname = subname_
|
subname = subname_
|
||||||
elif len_args == 1:
|
elif len_args == 1:
|
||||||
if func_id == "property":
|
if func_id == "property":
|
||||||
# Has just getter, read-only, need to define it using a wrapper.
|
# Has just getter, read-only, need to define it using a wrapper.
|
||||||
subname = (f"@{func_id}", f"def {subname_}(self): ...")
|
subname = (f"@{func_id}", f"def {subname_}(self): ...")
|
||||||
elif func_id == "staticmethod":
|
elif func_id == "staticmethod":
|
||||||
assert wrapped_function is not None
|
assert wrapped_function is not None
|
||||||
subname = (f"@{func_id}", f"def {subname_}({wrapped_function.split('(')[1]}")
|
subname = (f"@{func_id}", f"def {subname_}({wrapped_function.split('(')[1]}")
|
||||||
|
else:
|
||||||
|
assert_never(func_id)
|
||||||
else:
|
else:
|
||||||
assert_never(func_id)
|
assert_never(len_args)
|
||||||
else:
|
else:
|
||||||
assert_never(len_args)
|
attr_args = [
|
||||||
else:
|
arg
|
||||||
subname = subname_
|
for arg in value.args
|
||||||
|
if isinstance(arg, ast.Attribute)
|
||||||
|
and isinstance(arg.value, ast.Name)
|
||||||
|
and arg.value.id == "_ifcopenshell_wrapper"
|
||||||
|
]
|
||||||
|
assert len(attr_args) == 2
|
||||||
|
subname = subname_
|
||||||
|
|
||||||
if subname is not None:
|
if subname is not None:
|
||||||
subnames.add(subname)
|
subnames.add(subname)
|
||||||
@@ -226,6 +236,7 @@ def main() -> None:
|
|||||||
fromfile="stub.pyi classes",
|
fromfile="stub.pyi classes",
|
||||||
tofile="wrapper.py classes",
|
tofile="wrapper.py classes",
|
||||||
lineterm="",
|
lineterm="",
|
||||||
|
n=10,
|
||||||
)
|
)
|
||||||
diff = list(diff)
|
diff = list(diff)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user