Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Better detection of IX_ classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jl-wynen committed Nov 1, 2024
1 parent b66acfb commit dba1cf7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/sqomega/_read_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@ def write_object_array(
if objects.ty == ir.TypeTag.struct:
structs = objects.data
if len(structs) == 1:
from ._sqw import _get_scalar_struct_field

name = _get_scalar_struct_field(structs[0], 'serial_name')
if name.startswith('IX_'):
sqw_io.write_u8(32)
from ._sqw import AbortParse, _get_scalar_struct_field

try:
# TODO use better mechanism
name = _get_scalar_struct_field(structs[0], 'serial_name')
if name.startswith('IX_'):
sqw_io.write_u8(32)
except AbortParse:
pass

sqw_io.write_u8(objects.ty.value)
sqw_io.write_u8(len(objects.shape)) # TODO correct for list of structs?
Expand Down

0 comments on commit dba1cf7

Please sign in to comment.