-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit tests for out argument to processors #1805
Conversation
Thank you for the review @MargaretDuff :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating that Hannah! I am happy to approve.
Might suggest that we try and add some more comments to the unit tests so that if we implement new processors it is clear how add tests for them?
Thanks Margaret, I've added a few comments for new processors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes in the tests, but nothing major needed.
Signed-off-by: Hannah Robarts <[email protected]>
Thank you for the review Gemma, I think all the comments are resolved now |
Signed-off-by: Hannah Robarts <[email protected]>
Wrappers/Python/cil/plugins/astra/processors/AstraBackProjector2D.py
Outdated
Show resolved
Hide resolved
Wrappers/Python/cil/plugins/astra/processors/AstraBackProjector3D.py
Outdated
Show resolved
Hide resolved
Wrappers/Python/cil/plugins/astra/processors/AstraForwardProjector2D.py
Outdated
Show resolved
Hide resolved
Wrappers/Python/cil/plugins/astra/processors/AstraForwardProjector3D.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Hannah Robarts <[email protected]>
…to processors_out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great. And very good finding the hidden processors in plugins!
Description
Add tests to check if processors work in place. Check if processors give the same result when:
Added a check_output function in Processor to check the output type and size of an out argument that's passed to the prcessors. Slicer, Binner, Padded and MaskGenerator over-ride the base class to allow different type or size out argument.
Added a _set_up function in Processor to set the _shape_out attribute and other attributes that need to be set from the data.
CentreOfRotationCorrector only changes the data.geometry, not the data, so out_test fails. Instead we test the geometry is the same when used with or without out
Also update the documentation for Processor to reflect that the return value is not suppressed when out is passed
Added a new test to testclass.py to check if two DataContainers are close, by checking
Testing you performed
New tests have been added to test_out_in_place
Related issues/links
Should close #1669
Similar to #1657 for processors
Checklist
Contribution Notes
Please read and adhere to the developer guide and local patterns and conventions.