Context
The _default_stack_from_rotation_angle function in mdx2/data.py (lines 758-791) implements complex modulo-arithmetic heuristics across 8+ conditional branches to compute a reasonable image stack size given the rotation angle per frame.
Requirements
Add unit tests to validate the heuristics covering:
- Documented rotation angles: 0.1°, 0.025°, 1/3°, 0.04°, 0°
- Edge cases: very small angles (>0), very large angles (e.g., >6°)
- Specific modulo branches:
5*denom%numer==0
6*denom%numer==0
2*50*numer%denom==0
2*40*numer%denom==0
2*45*numer%denom==0
4*50*numer%denom==0
4*45*numer%denom==0
- Default fallback cases
Suggested Approach
Create a pytest file (e.g., tests/test_data_stack_size.py) with parametrized tests that:
- Call
_default_stack_from_rotation_angle with each test case
- Assert the expected integer result for each input
- Ensure all conditional branches are covered
Related
Context
The
_default_stack_from_rotation_anglefunction inmdx2/data.py(lines 758-791) implements complex modulo-arithmetic heuristics across 8+ conditional branches to compute a reasonable image stack size given the rotation angle per frame.Requirements
Add unit tests to validate the heuristics covering:
5*denom%numer==06*denom%numer==02*50*numer%denom==02*40*numer%denom==02*45*numer%denom==04*50*numer%denom==04*45*numer%denom==0Suggested Approach
Create a pytest file (e.g.,
tests/test_data_stack_size.py) with parametrized tests that:_default_stack_from_rotation_anglewith each test caseRelated