mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 19:07:57 +00:00
b1be7d92e6
check_aggregate_of_type used an exact type comparison (element->ob_type == type_obj), so a numpy array was rejected because its elements are numpy scalars (numpy.float64) rather than direct float instances. For the numeric types, accept subclasses: PyFloat_Check for double (numpy.float64 subclasses float) and PyLong_Check (excluding bool) for int. The SPF REAL vs INTEGER distinction is kept, so a float is not accepted where an int is expected and vice versa. This replaces the earlier Python-side walk() approach, which the maintainer preferred not to take since walk() is removed in v0.9. Verified with a runtime red-green (built as a shared lib, called via ctypes): the old check rejects np.array([3.0, 4.0]) and the new one accepts it, plain lists still work, an int list is still rejected where a REAL is expected, and bool is rejected for INTEGER. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>