Commit Graph

99 Commits

Author SHA1 Message Date
Stephen Boddy d5e890bccd Fix ty-ios type-check errors (ifcopenshell-python side)
poe ty's sequence only reaches ty-ios once ty-bonsai passes, so these
never surfaced until now:

- util/alignment.py: drop the stale `include_referent=False` kwarg from
  add_zero_length_segment() - that parameter was removed from the function's
  signature in 45ea5eb07 but this caller in a different file was missed,
  leaving a latent TypeError if this code path is ever exercised.
- ifcopenshell_wrapper.pyi: add the optional trailing `logger` parameter to
  parse_ifcxml/open/construct_iterator*, matching the real SWIG signatures
  in src/ifcwrap/*.i (all declare `Logger& logger = Logger::Root()`) that
  the hand-maintained stub never picked up.
- ifcopenshell/__init__.py: remove a stale `ty: ignore[unknown-argument]`
  comment that ty confirms is no longer suppressing anything.
- assign_cost_item_quantity.py: OPERATORS mixes 2-arg binary operators with
  the 1-arg `operator.neg` (for ast.USub), but FormulaEvaluator has no
  visit_UnaryOp so USub can never reach this lookup via visit_BinOp.
  Suppressed at the call site rather than touching the dict, since this
  looks like scaffolding for unary-minus support rather than dead code.
- Explicit submodule imports (ifcopenshell.geom / api.alignment / util.unit
  / api.aggregate / api.context / api.spatial) added where accessed but
  only reachable by accident of import order.
2026-07-10 22:19:56 +01:00
Thomas Krijnen 6a6756de66 Bump binary versions in makefiles; add backwards compatibility to logger usage in python #8167 2026-06-15 09:56:36 +02:00
Thomas Krijnen ca99ef3af7 More changes to pass around logger to parse-related calls 2026-06-14 14:49:14 +02:00
Thomas Krijnen a7738eeb64 Pass around non-static logger instances and programmatic access to messages in-memory 2026-06-10 18:40:17 +02:00
Andrej730 9d78df392d black . 2026-04-01 10:37:07 +05:00
Andrej730 86bef0a254 typing 2026-04-01 10:37:06 +05:00
Andrej730 26280d24fe Add ty to check for missing symbols and other simple errors 2026-03-20 15:36:14 +05:00
Andrej730 30551cb288 typing 2026-03-20 15:36:14 +05:00
Andrej730 92c979fbbf black . 2026-02-27 14:52:55 +05:00
Andrej730 dfc91e6639 ifcopenshell-python - clean up unused imports 2026-01-16 17:16:24 +05:00
Andrej730 13be6ccd45 Sort imports 2025-12-19 18:53:14 +05:00
Andrej730 29ab446f8c use common rst syntax in doc-strings 2025-11-17 16:30:27 +05:00
Andrej730 e46a99870b typing 2025-11-17 16:30:24 +05:00
Thomas Krijnen f0a1efa1f2 ruff --fix 2025-10-25 15:27:46 +02:00
Thomas Krijnen 0494bd9677 Option to bypass storing types when opening model 2025-10-24 12:06:59 +02:00
Thomas Krijnen a6d20c0cc4 Follow up after 4d688170e0 2025-10-22 21:42:37 +02:00
Andrej730 923e8423f9 black . 2025-09-29 16:43:28 +05:00
Dion Moult 0fe869c169 See #7131. Rollback to prevent instant segfaults on Linux. 2025-09-28 18:15:13 +10:00
Thomas Krijnen ab59173135 Add a stream2_from_string() (mostly for wasm) 2025-09-23 11:32:52 +02:00
Andrej730 a86904dd41 ifcopenshell.open overload signature to consider new readonly argument 2025-09-12 20:11:07 +05:00
Andrej730 8a82343e27 typing - fix annoying module symbol getting into ifcopenshell.open retun types 2025-09-12 20:11:07 +05:00
Thomas Krijnen a0b93265c2 Rocksdb storage -- ifcopenshell.file compatibility 2025-09-09 13:25:32 +02:00
Thomas Krijnen 59a5bf2344 RocksDB zstd encryption; cache tuning; readonly open mode 2025-09-03 11:11:55 +02:00
Thomas Krijnen 8888e45115 Run black 2025-08-26 12:54:23 +02:00
Thomas Krijnen 2f62064814 Python impl function 2025-08-26 12:53:06 +02:00
Thomas Krijnen 9d9e9ed4cb Merge remote-tracking branch 'origin/v0.8.0' into tfk-rocksdb-storage 2025-08-26 10:17:57 +02:00
Thomas Krijnen d2c7c1532c Implement streaming scan through file and use in rocksdb serializer and python 2025-08-25 12:45:10 +02:00
Andrej730 36b86bbb54 Apply RUF022 (sorted __all__) 2025-08-08 19:12:11 +05:00
Andrej 87265d052b typing 2025-06-05 19:05:27 +05:00
Andrej 0663c5130a typing 2025-05-29 19:14:42 +05:00
Andrej c838139fdc Fix Ruff UP024 (os-error-alias)
https://docs.astral.sh/ruff/rules/os-error-alias/
2025-05-28 18:24:11 +05:00
Thomas Krijnen c935b2fc12 Merge branch 'v0.8.0' into tfk-rocksdb-storage 2025-03-25 13:05:45 +01:00
Andrej730 2f87029434 Use schema_identifier to get IFC4X3 schema more precisely 2025-03-14 18:19:07 +05:00
Thomas Krijnen 6cefb2e991 Update .py guess_format() 2025-03-14 10:32:11 +01:00
Andrej730 f1080a8278 ifcopenshell.open - more robust file existence check 2024-12-23 16:19:56 +05:00
Chris Mayo 65ecb92c03 python: Fix ifcopenshell.guid.new()
pyException:

<class 'AttributeError'>: module 'ifcopenshell' has no attribute 'guid'
2024-10-20 14:01:34 +02:00
Andrej730 9130659f71 ifcopenshell.open - readable error if file doesn't exist
Previously it would show obscure error like:

RuntimeError: Type held at index 0 is class Blank and not class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >
2024-10-18 18:11:58 +05:00
Andrej730 4e3d6f1773 typing 2024-09-24 19:30:07 +05:00
Andrej730 0891df5d6c typing 2024-09-16 18:54:12 +05:00
Dion Moult 2d5be6cf89 Search replace 0.7.0 with 0.8.0 2024-06-27 11:49:12 +10:00
Andrej730 d2e7e3daaf move ifc file handling logic to ifcopenshell.file
to reuse the same logic for both ifcopenshell.open and ifcopenshell.file.from_string()
2024-06-25 18:30:51 +05:00
Dion Moult b009913cf4 Fix #4511. IfcOpenShell builds now read from the VERSION file and expose a __version__ var. 2024-06-11 13:11:14 +10:00
Andrej730 7f2c7eb467 python 3.9 compatibility 2024-05-23 18:45:31 +05:00
Andrej730 6e2edbf101 explicitly specify available imported symbols
Fix LSP warnings like ""entity_instance" is not exported from module "ifcopenshell"PylancereportPrivateImportUsage" for `ifcopenshell.file`, `ifcopenshell.entity_instance` etc.

After adding py.typed in 722201a1a it's now a typed library and all imported symbols in modules are considered private by default and should be added to `__all__` if they are supposed to be generally available from imported module.

See https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface
2024-05-09 13:35:29 +05:00
Dion Moult 93639e9e50 Even more cleaning of documentation references 2024-05-07 19:08:13 +10:00
Dion Moult d76462ca42 Write more documentation
Sphinx autoapi also now only shows subpackages 1 level deep. This prevents us having a huge long list. Also don't show private or special members. Also show imported members so ifcopenshell.file and ifcopenshell.entity_instance works in docs too.
2024-05-07 17:32:47 +10:00
Dion Moult 424a06f6c8 More cleaning up of forward type hints to fix import errors 2024-05-07 14:58:12 +10:00
Dion Moult 89c4cbeb05 Drop support for Python 2. 2024-05-07 12:17:46 +10:00
Dion Moult 7e13ed746e Don't rely on util for basic ifcopenshell module capabilities. Keep util as an optional module for users to load. 2024-05-07 10:32:02 +10:00
Andrej730 4efe284338 use IFC4X3_ADD2 for ifcopenshell.schema_by_name
as it is the main IFC4X3 schema
2024-04-22 17:30:25 +05:00