True when ``ue_shape`` can legitimately back ``c_shape``. A ``TArray `` (array) is shape-compatible with a fixed-size C array (vec) because the codegen writes ``prop.Num()`` elements into the C array. Vec-to-vec requires the dim to match exactly. Scalar↔array always mismatches
(ue_shape: tuple, c_shape: tuple)
| 337 | |
| 338 | |
| 339 | def _shapes_compatible(ue_shape: tuple, c_shape: tuple) -> bool: |
| 340 | """True when ``ue_shape`` can legitimately back ``c_shape``. |
| 341 | |
| 342 | A ``TArray<X>`` (array) is shape-compatible with a fixed-size C |
| 343 | array (vec) because the codegen writes ``prop.Num()`` elements |
| 344 | into the C array. |
| 345 | Vec-to-vec requires the dim to match exactly. |
| 346 | Scalar↔array always mismatches. Opaque C shapes are skipped.""" |
| 347 | if c_shape[0] == "opaque": |
| 348 | return True |
| 349 | if ue_shape[0] == c_shape[0]: |
| 350 | if ue_shape[0] == "vec": |
| 351 | return ue_shape[1] == c_shape[1] |
| 352 | return True |
| 353 | if ue_shape[0] == "array" and c_shape[0] == "vec": |
| 354 | return True |
| 355 | return False |
| 356 | |
| 357 | |
| 358 | # --------------------------------------------------------------------------- |
no outgoing calls
no test coverage detected