As suggested by @HGSilveri:
Add two new methods to Device:
[ ] Device.is_calibrated_layout(layout: RegisterLayout): Checks whether a layout is within the calibrated layouts.
[ ] Device.register_is_from_calibrated_layout(register: BaseRegister|MappableRegister): Checks whether the register was constructed from a pre-calibrated layout (ie checks if it has a layout AND is_calibrated_layout(layout))
As discussed, returns a boolean and not an error.
register_is_from_calibrated_layout works with BaseRegister (hence Register and Register3D) and MappableRegister (always has a layout in this case) because the type of the register in a sequence can be of type one of these two types.
As suggested by @HGSilveri: Add two new methods to
Device
:Device.is_calibrated_layout(layout: RegisterLayout)
: Checks whether a layout is within the calibrated layouts.Device.register_is_from_calibrated_layout(register: BaseRegister|MappableRegister)
: Checks whether the register was constructed from a pre-calibrated layout (ie checks if it has a layout ANDis_calibrated_layout(layout)
) As discussed, returns a boolean and not an error. register_is_from_calibrated_layout works with BaseRegister (hence Register and Register3D) and MappableRegister (always has a layout in this case) because the type of the register in a sequence can be of type one of these two types.Closes #577