Skip to content

Commit 69863ce

Browse files
committed
Try and fix stub test
1 parent e5ae19f commit 69863ce

File tree

3 files changed

+75
-39
lines changed

3 files changed

+75
-39
lines changed

src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi

Lines changed: 67 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ FILTERED_CARTESIAN_QUOTIENT: Any
7171
EXACT_PREDICATES: Any
7272
EXACT_CONSTRUCTIONS: Any
7373

74+
FT_AUTODETECT: Any
75+
FT_IFCSPF: Any
76+
FT_IFCXML: Any
77+
FT_IFCZIP: Any
78+
FT_ROCKSDB: Any
79+
FT_UNKNOWN: Any
80+
7481
CURVES: Any
7582
SURFACES_AND_SOLIDS: Any
7683
CURVES_SURFACES_AND_SOLIDS: Any
@@ -96,12 +103,9 @@ class IfcSpfHeader:
96103
"""
97104

98105
def file(self, *args): ...
99-
@property
100-
def file_description(self) -> ifcopenshell.entity_instance: ...
101-
@property
102-
def file_name(self) -> ifcopenshell.entity_instance: ...
103-
@property
104-
def file_schema(self) -> ifcopenshell.entity_instance: ...
106+
def file_description_py(self): ...
107+
def file_name_py(self): ...
108+
def file_schema_py(self): ...
105109
def read(self): ...
106110
def tryRead(self): ...
107111
def write(self, out): ...
@@ -145,6 +149,7 @@ class ConversionResult:
145149
def Style(self): ...
146150
def StylePtr(self): ...
147151
def append(self, trsf): ...
152+
def apply_transform(self, unit_scale): ...
148153
def hasStyle(self): ...
149154
def prepend(self, trsf): ...
150155
def setStyle(self, newStyle): ...
@@ -157,6 +162,7 @@ class ConversionResultShape:
157162
def axis(self): ...
158163
def bounding_box(self, *args): ...
159164
def box(self): ...
165+
def concat(self, arg2): ...
160166
def convex_decomposition(self): ...
161167
def convex_tag(self, b): ...
162168
def edges(self): ...
@@ -178,9 +184,11 @@ class ConversionResultShape:
178184
def solid(self): ...
179185
def solid_mt(self): ...
180186
def subtract(self, arg2): ...
187+
def surface_area_along_direction(self, tol, arg3, along_x, along_y, along_z): ...
181188
def surface_genus(self): ...
182189
def vertices(self): ...
183190
def volume(self): ...
191+
def wrap_in_compound(self): ...
184192

185193
class DoubleArray3:
186194
def back(self): ...
@@ -284,11 +292,6 @@ class HdfSerializer(GeometrySerializer):
284292
def write(self, *args): ...
285293
def writeHeader(self): ...
286294

287-
class HeaderEntity:
288-
def getArgument(self, index): ...
289-
def getArgumentCount(self): ...
290-
def toString(self, upper): ...
291-
292295
class IfcBaseEntity(entity_instance):
293296
def declaration(self): ...
294297
def get(self, name): ...
@@ -304,9 +307,17 @@ class IfcEntityInstanceData: ...
304307
class IfcLateBoundEntity(IfcBaseEntity):
305308
def declaration(self): ...
306309

307-
class InstanceReference:
308-
file_offset: Any
309-
v: Any
310+
class InstanceStreamer:
311+
def bypassTypes(self, type_names): ...
312+
def bypassed_instances(self): ...
313+
coerce_attribute_count: bool
314+
def hasSemicolon(self): ...
315+
def inverses(self, *args): ...
316+
def pushPage(self, page): ...
317+
def readInstancePy(self, type_as_declaration_instance): ...
318+
def references(self, *args): ...
319+
def semicolonCount(self): ...
320+
def status(self): ...
310321

311322
class Iterator:
312323
initialization_outcome_: Any
@@ -377,6 +388,17 @@ class Representation:
377388

378389
def settings(self): ...
379390

391+
class RocksDBPrefixIterator:
392+
def key(self): ...
393+
def next(self): ...
394+
def valid(self): ...
395+
def value(self): ...
396+
class RocksDbSerializer:
397+
def finalize(self): ...
398+
def ready(self): ...
399+
def setFile(self, arg2): ...
400+
def writeHeader(self): ...
401+
380402
class Serialization(Representation):
381403
@property
382404
def brep_data(self): ...
@@ -829,6 +851,7 @@ class entity_instance:
829851
...
830852

831853
def get_attribute_names(self): ...
854+
def get_attribute_value(self, index): ...
832855
def get_inverse(self, a): ...
833856
def get_inverse_attribute_names(self): ...
834857
def id(self) -> int: ...
@@ -851,6 +874,7 @@ class entity_instance:
851874
def setArgumentAsLogical(self, i, v): ...
852875
def setArgumentAsNull(self, i): ...
853876
def setArgumentAsString(self, i, a): ...
877+
def set_attribute_value(self, *args): ...
854878
def toString(self, arg2, upper): ...
855879
def to_string(self, valid_spf): ...
856880
def unset_attribute_value(self, i): ...
@@ -888,14 +912,10 @@ class face:
888912
def print_impl(self, o, indent): ...
889913

890914
class file:
891-
INSTANCE_ID: Any
892-
INSTANCE_TYPE: Any
893-
ATTRIBUTE_INDEX: Any
894-
guid_map_: Any
895-
stream: Any
896915
def FreshId(self): ...
897916
def add(self, entity: entity_instance, id: int) -> entity_instance: ...
898917
def addEntities(self, entities): ...
918+
def add_type_ref(self, new_entity): ...
899919
def batch(self) -> None:
900920
"""Enable batch mode.
901921
@@ -919,10 +939,15 @@ class file:
919939
...
920940

921941
def build_inverses(self): ...
942+
def build_inverses_(self, arg2): ...
922943
def by_guid(self, guid: str) -> entity_instance: ...
923944
def by_id(self, id: int) -> entity_instance: ...
924945
def by_type(self, *args): ...
925946
def by_type_excl_subtypes(self, *args): ...
947+
def bypass_type(self, type_name): ...
948+
calculate_unit_factors: bool
949+
check_existance_before_adding: bool
950+
def create(self, decl): ...
926951
@staticmethod
927952
def createTimestamp(): ...
928953
def entity_names(self) -> tuple[int, ...]:
@@ -961,41 +986,43 @@ class file:
961986

962987
def get_total_inverses(self, e: entity_instance) -> int: ...
963988
def good(self): ...
964-
@staticmethod
965-
def guid_map(*args): ...
966-
def header(self) -> IfcSpfHeader:
989+
def header(self, *args) -> IfcSpfHeader:
967990
"""Internal IfcSpfHeader instance, always prefer ``ifcopenshell.file.header`` instead."""
968991

969992
def ifcroot_type(self) -> entity: ...
970-
def internal_guid_map(self): ...
971-
def load(self, entity_instance_name, entity, arg4, attribute_index): ...
993+
def initialize(self, *args): ...
994+
instantiate_typed_instances: bool
995+
def key_value_store_iter(self, prefix): ...
996+
def key_value_store_query(self, key): ...
997+
def process_deletion_inverse(self, inst): ...
972998
def recalculate_id_counter(self): ...
973999
def remove(self, entity: entity_instance) -> None: ...
1000+
def remove_type_ref(self, new_entity): ...
1001+
def reset_identity_cache(self): ...
9741002
@property
9751003
def schema(self): ...
1004+
def storage_mode(self): ...
9761005
def to_string(self): ...
9771006
@staticmethod
9781007
def traverse(instance: entity_instance, max_level: int) -> tuple[entity_instance, ...]: ...
9791008
@staticmethod
9801009
def traverse_breadth_first(instance: entity_instance, max_level: int) -> tuple[entity_instance, ...]: ...
981-
def try_read_semicolon(self): ...
9821010
def types(self) -> tuple[str, ...]:
9831011
"""Return a tuple of classes present in the file.
9841012
9851013
E.g. `("IfcWallType", "IfcWall", "IfcArbitraryClosedProfileDef", ...)`.
9861014
"""
9871015
...
9881016

989-
def types_begin(self): ...
990-
def types_end(self): ...
9911017
def write(self, fn): ...
9921018

9931019
class file_open_status:
994-
SUCCESS: Any
995-
READ_ERROR: Any
996-
NO_HEADER: Any
997-
UNSUPPORTED_SCHEMA: Any
998-
INVALID_SYNTAX: Any
1020+
SUCCESS: int
1021+
READ_ERROR: int
1022+
NO_HEADER: int
1023+
UNSUPPORTED_SCHEMA: int
1024+
INVALID_SYNTAX: int
1025+
UNKNOWN: int
9991026
def value(self): ...
10001027

10011028
class fn_evaluator:
@@ -1037,9 +1064,6 @@ class geometry_conversion_result:
10371064
products_2: Any
10381065
representation: Any
10391066

1040-
class geometry_exception:
1041-
def what(self): ...
1042-
10431067
class gradient_function(function_item):
10441068
def calc_hash(self): ...
10451069
def clone_(self): ...
@@ -1138,6 +1162,8 @@ class matrix4(item):
11381162
def is_identity(self): ...
11391163
def kind(self): ...
11401164
def translation_part(self): ...
1165+
def post_multiply_scale(self, s): ...
1166+
def pre_multiply_scale(self, s): ...
11411167

11421168
class named_type(parameter_type):
11431169
def _is(self, *args): ...
@@ -1516,13 +1542,11 @@ class sweep(geom_item):
15161542
class sweep_along_curve(sweep):
15171543
curve: Any
15181544
surface: Any
1545+
direction: Any
15191546
def calc_hash(self): ...
15201547
def clone_(self): ...
15211548
def kind(self): ...
15221549

1523-
class too_many_faces_exception(geometry_exception): ...
1524-
class topology_error: ...
1525-
15261550
class torus(surface):
15271551
radius1: Any
15281552
radius2: Any
@@ -1568,6 +1592,8 @@ class type_declaration(declaration):
15681592
def as_type_declaration(self) -> type_declaration: ...
15691593
def declared_type(self): ...
15701594

1595+
class uninitialized_tag: ...
1596+
15711597
def arrange_polygons(polygons): ...
15721598
def clear_schemas(): ...
15731599
def construct_iterator_with_include_exclude(geometry_library, settings, file, elems, include, num_threads): ...
@@ -1581,14 +1607,15 @@ def flatten(deep): ...
15811607
def get_feature(x): ...
15821608
def get_info_cpp(v, include_identifier): ...
15831609
def get_log(): ...
1610+
def guess_file_type(fn): ...
15841611
def helmert_curve_point(A0, A1, A2, s): ...
15851612
def kind_to_string(k): ...
15861613
def less(arg1, arg2): ...
15871614
def line_segments_to_polygons(s, eps, segments): ...
15881615
def map_shape(settings, instance): ...
15891616
def nary_union(sequence): ...
15901617
def new_IfcBaseClass(schema_identifier: str, name: str) -> entity_instance: ...
1591-
def open(fn): ...
1618+
def open(fn, readonly): ...
15921619
def parse_ifcxml(filename): ...
15931620
def polygons_to_svg(*args): ...
15941621
def read(data): ...
@@ -1599,6 +1626,7 @@ def serialise(schema_name, shape_str, advanced): ...
15991626
def set_feature(x, v): ...
16001627
def set_log_format_json(): ...
16011628
def set_log_format_text(): ...
1629+
def stream_from_string(data): ...
16021630
def svg_to_line_segments(data, class_name): ...
16031631
def svg_to_polygons(data, class_name): ...
16041632
def taxonomy_item_repr(i): ...

src/ifcwrap/IfcParseWrapper.i

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ private:
3333
%ignore IfcParse::IfcFile::types_end;
3434
%ignore IfcParse::IfcFile::internal_guid_map;
3535
%ignore IfcParse::IfcFile::storage_;
36+
%ignore IfcParse::IfcFile::byguid_;
37+
%ignore IfcParse::IfcFile::byid_;
38+
%ignore IfcParse::IfcFile::byref_excl_;
39+
%ignore IfcParse::IfcFile::types_to_bypass_loading_;
3640

3741
%ignore IfcParse::InstanceStreamer::InstanceStreamer(const IfcParse::schema_definition* schema, IfcParse::IfcSpfLexer* lexer);
3842

src/ifcwrap/IfcPython.i

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@
9393
%ignore curve_to_face_upgrade_impl;
9494
%ignore loop_to_function_item_upgrade_impl;
9595

96+
%ignore IfcGeom::geometry_exception;
97+
%ignore IfcGeom::too_many_faces_exception;
98+
%ignore ifcopenshell::geometry::taxonomy::topology_error;
99+
96100
// settings, can this done more generally?
97101
// GeometrySerializer.h
98102
%ignore UseElementNames;

0 commit comments

Comments
 (0)