Commit Graph

39 Commits

Author SHA1 Message Date
Dion Moult 19a1d88970 Fix all ty diagnostics on ifcviewer-wgpu (ci-lint ty-ios + ty-bonsai)
This branch carried v0.8.0's strict `[tool.ty.rules] all = "error"` config but
not the source fixes that were made upstream to satisfy it, so both ci-lint ty
gates were failing: `poe ty-ios` reported 256 diagnostics and `poe ty-bonsai`
258. Both are now clean.

Most fixes are ported from v0.8.0 and follow two idioms: initialise a name
before a conditional that may not bind it (plus an `assert` where the invariant
is real but not provable), and close an exhaustive `if`/`elif` chain with
`else: assert False, <discriminant>`.

The branch's own newer accessors are preserved throughout - `.file`,
`.declaration`, `file.types()`, `get_max_id()` are kept rather than reverted to
`wrapped_data.*`, and non-ty upstream changes (notably the in-progress geometry
cache removal) are deliberately not pulled in.

Notable fixes that are not straight ports:

* ifcopenshell_wrapper.pyi: `entity_instance.file` was declared as
  `def file(self) -> file`, where the property name shadows the `class file`
  below it, so the annotation resolved to `Unknown`. Every `element.file` in
  the codebase was therefore unchecked. Qualifying it to `ifcopenshell.file`
  restores `.schema` to its Literal union and surfaces no new diagnostics.

* model/wall.py: a duplicated merge fragment in the void-straddle path ran an
  always-true `if void_straddles:` that read `new_opening` from the mutually
  exclusive branch (stale value, or NameError on the first iteration), followed
  by an unreachable duplicate `elif`. Removing it makes the file match v0.8.0.

* light/operator.py: upstream's own fix unpacks three targets from two values
  and raises ValueError unconditionally; corrected to `None, None, None`.

* assign_system.py, validate.py, geom/main.py: walrus-in-genexp is valid at
  runtime (PEP 572 binds in the containing scope) but ty does not model it;
  rewritten as explicit loops, matching upstream.

Verified: poe ty-ios, poe ty-bonsai, ruff check src/ nix/, black --check .,
and compileall -W error at py3.10 (ifcopenshell-python) and py3.11 (bonsai).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 19:14:39 +10:00
Bartok 54dfbefc79 docs(ifc2ca): fix script paths in README
Point scriptSalome.py at templates/salome/ and the bonded scripts at
_deprecated/, matching the current tree so README links resolve.

Generated with the assistance of an AI coding tool.

(cherry picked from commit a45f2fae61)
2026-07-25 23:18:32 +10:00
Andrej730 92c979fbbf black . 2026-02-27 14:52:55 +05:00
Andrej730 13be6ccd45 Sort imports 2025-12-19 18:53:14 +05:00
Andrej730 cc7732ecbf Replace .wrapped_data.header with .header (dfaa8d5) 2025-09-15 18:27:21 +05:00
Andrej730 a12bb343ca Fix RUF015 (next() instead of list comprehensions[0])
https://docs.astral.sh/ruff/rules/-iterable-allocation-for-first-element/
2025-06-16 19:55:25 +05:00
Andrej 7d4176d105 Fix Ruff UP006 (deprecated annotation symbols) 2025-06-09 18:03:18 +05:00
Andrej 92a222cda7 typing 2025-05-30 18:13:10 +05:00
Andrej f289b55766 Fix Ruff UP010 (unnecessary-future-import)
https://docs.astral.sh/ruff/rules/unnecessary-future-import/
2025-05-28 18:24:12 +05:00
Andrej 3b50993b21 ifc2ca, bcf, opencdeserver - add Python 3.9 support
Was breaking due to `|` operator used in annotations instead of `Union`
2025-05-28 18:24:11 +05:00
Dion Moult e7b791f4a2 Run black on utils 2024-07-26 12:16:36 +10:00
Dion Moult 2d5be6cf89 Search replace 0.7.0 with 0.8.0 2024-06-27 11:49:12 +10:00
Andrej730 cbf04546b8 fix many implicit ifcopenshell.guid imports
a bit related to 10d30b0de
2024-05-08 18:18:02 +05:00
Ioannis P. Christovasilis b33378e135 ifc2ca major update - todo: update readme file 2024-01-18 12:53:31 +01:00
Martin15135215 5a9dbc5a36 CITATION.cff for ifc2ca 2023-06-08 09:45:54 +10:00
Jesusbill 37d20eb360 changes in ifc2ca standard case 2021-12-17 17:01:18 +01:00
Jesusbill dd6912bdaa ifc2ca - possibility to exclude zero length springs in point connections 2021-12-17 16:27:41 +01:00
Jesusbill a1fe68a17e changes in ifc2ca bonded case 2021-12-17 09:58:02 +01:00
Jesusbill 4e9a5f246f minor changes in ifc2ca scripts 2021-12-12 19:03:14 +01:00
luzpaz 0aa8a19b6d Fix various typos (#1837)
Found via `codespell`
2021-10-29 08:56:02 +11:00
Dion Moult ab8fd0a6fe WIP licenses. See #1082. 2021-08-07 21:15:36 +10:00
Dion Moult 5cf07a910e Include licenses on IfcOpenShell sub-utilities. See #1082. 2021-08-04 10:51:31 +10:00
Jesusbill ca59b3220b small fix and mod in ifc2ca 2021-03-19 23:39:25 +01:00
Jesusbill 0b39226869 update readme and changelog 2021-03-01 23:39:13 +01:00
Jesusbill 9e31991e75 add "bonded" case for mesh and run 2021-03-01 23:22:55 +01:00
Bernd Hahnebach 02fa8c8413 [read carefully before decide merge] !!! normalize line endings of src files (#1268)
* all source: prepare to normalize line ending

* all src: normalize line endings
2021-01-22 08:22:34 +11:00
htlcnn d6881e833d black ifc2ca 2020-11-01 23:50:02 +11:00
Jesusbill 95d6685597 add curve connections 2020-10-14 11:13:23 +02:00
Jesusbill cf6ec3777f update changelog - ifc2ca 2020-08-17 20:35:16 +02:00
Jesusbill 7f48923153 add rigid connections - add spring stiffness for point connections 2020-08-17 17:05:31 +02:00
Jesusbill 2a6b3b981a update changelog 2020-07-15 00:33:06 +02:00
Jesusbill a8d261f271 add zero-length springs for point connections and connection-to-member 2020-07-14 21:48:54 +02:00
Jesusbill 6c22894a93 import elements with no material or profile 2020-07-14 21:44:14 +02:00
Jesusbill 6e8eca37ef experimental ca2ifc (json -> ifc) for creating example files 2020-07-14 21:40:23 +02:00
Jesusbill 82ada5c102 minor fix in ifc2ca (revert a bad modification :|) 2020-06-01 01:41:20 +02:00
Jesusbill 9fa89651c4 minor fixes in ifc2ca 2020-06-01 01:26:35 +02:00
Jesusbill e071c7812f major update, refactoring to consider generalization of connections 2020-05-27 05:33:36 +02:00
Jesusbill 2d2c5cfc3d add orientation in the json file for point and line geometries 2020-05-04 05:34:19 +02:00
Jesusbill 4786dc78a3 create ifc2ca dedicated folder and populate with existing scripts 2020-04-07 16:10:42 +02:00