Conversation
…ension functions in layer_combination.py
…tionaries for testing.
…py. Also reorganizing test file to match funciton order in layer_combination.
castelao
left a comment
There was a problem hiding this comment.
@scottmello37 , this looks great! Thanks for doing this. I particularly liked that you're taking advantage of fixtures to avoid redundancies in the tests and also that you don't try to cover many things in a single test. It's easier to take advantage of foccused tests.
I suggest you use more docstrings in the functions. You don't need to do it complete as we would do for a regular function, but just some hints on the concept of that test and what to expect. The limit here is only your time, otherwise, add as much information as you think useful without stalling your production.
The VoterVeto covers almost half of the module, and I imagine that eventually we will add more tests. What about istolating it in its own module? What about transform test_layer_combination in a module (directory with __init__.py inside it) and distribute the current tests in test_core.py (or test_misc.py or whatever you prefer) plus test_voter_veto.py?
…developers per Gui's comments. Added comments in each section describing the functions being tests. Added docstrings in each testing function to explain them concisely.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #41 +/- ##
==========================================
+ Coverage 15.58% 22.64% +7.06%
==========================================
Files 18 18
Lines 2804 2804
Branches 434 434
==========================================
+ Hits 437 635 +198
+ Misses 2340 2126 -214
- Partials 27 43 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@castelao, thank you for reviewing this! I have added documentation according to your guidance in 956eef8. I plan to add the do_voter_veto tests to their own testing module as you have recommended in a subsequent PR. If you do not mind doing a final review/approval on this one, I will finalize and merge. |
This PR adds a set of unit tests for layer_combination.py. The tests cover the geometry and PFA dimensionality detection, NaN handling in the prepare_for_combination and do_voter_veto functions, veto and modified-veto behavior, and basic end-to-end do_voter_veto flows for both 2D and 3D cases.
@castelao , I would love your thoughts on this test style. I tried to target the tests around just the most important parts of each function.