Test for correct applycutoff #63
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #61
Replaces #62 and #47. Please see there for extensive discussion.
@bobleesj @cadenmyers13 I wrote a test for the
applycutoff()
method.this is what I wanted to do so that we can catch the right behavior.
tbh I don't like the fourigui code, it is not modular and well separated, making it hard to understand and hard to test, but I don't want to do a big refactor on this code.
Still, take a look at the test and hopefully you can see this as an example of how to test a function/method like this. I hope it is helpful. The key difference from before is that I hand-wrote an array that I KNOW has the behavior that I want. It is an easily understandable 5x5x5 array that is the smallest array that can have both a qmin and qmax.
I guess that for all tests to pass we may have to do @cadenmyers13 fix of the h5 test data which is wrong because it was generated by the code which was wrong. But this shows how testing can catch that. If you test code using data that was generated using the code, of couse it will pass, and you are not testing anything really......