Most sirf.Reg handles input parsing by raising AssertionError().
I see 2 things that may need improvement, but please do let me know if I am wrong:
AssertionError() is an error from when an assert (i.e. something that should always be true, and enforced by the code) fails. Input parsing does not fit into this description, so I think the correct error to raise is TypeError(). This of course, is not a super important thing.
if not isinstance(floating_image, SIRF.ImageData):
raise some_error_handler("Floating image should be of type SIRF.ImageData but its pf type "+ type(floating_image) +" instead.")
Most sirf.Reg handles input parsing by raising
AssertionError()
.I see 2 things that may need improvement, but please do let me know if I am wrong:
AssertionError()
is an error from when an assert (i.e. something that should always be true, and enforced by the code) fails. Input parsing does not fit into this description, so I think the correct error to raise isTypeError()
. This of course, is not a super important thing.or something like that.